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. | |
Time (const unsigned &ndt) | |
Constructor: Pass the number of timesteps to be stored and set the initial value of time to zero. | |
Time (const Time &)=delete | |
Broken copy constructor. | |
void | operator= (const Time &)=delete |
Broken assignment operator. | |
void | resize (const unsigned &n_dt) |
Resize the vector holding the number of previous timesteps and initialise the new values to zero. | |
void | initialise_dt (const double &dt_) |
Set all timesteps to the same value, dt. | |
void | initialise_dt (const Vector< double > &dt_) |
Set the value of the timesteps to be equal to the values passed in a vector. | |
~Time () | |
Destructor: empty. | |
double & | time () |
Return the current value of the continuous time. | |
unsigned | ndt () const |
Return the number of timesteps stored. | |
double & | dt (const unsigned &t=0) |
Return the value of the t-th stored timestep (t=0: present; t>0: previous). | |
double | dt (const unsigned &t=0) const |
Return the value of the t-th stored timestep (t=0: present; t>0: previous), const version. | |
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). | |
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. | |
Private Attributes | |
double | Continuous_time |
Pointer to the value of the continuous time. | |
Vector< double > | Dt |
Vector that stores the values of the current and previous timesteps. | |
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.
|
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.
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.
|
inline |
Destructor: empty.
Definition at line 120 of file timesteppers.h.
Return the value of the t-th stored timestep (t=0: present; t>0: previous).
Definition at line 136 of file timesteppers.h.
Referenced by oomph::IMRByBDF::actions_after_timestep(), oomph::IMRByBDF::actions_before_timestep(), oomph::Problem::adaptive_unsteady_newton_solve(), oomph::Problem::calculate_predictions(), oomph::Problem::copy(), oomph::Problem::doubly_adaptive_unsteady_newton_solve_helper(), oomph::Problem::dump(), oomph::Problem::explicit_timestep(), oomph::GeneralisedNewtonianAxisymmetricNavierStokesEquations::extrapolated_strain_rate(), oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::extrapolated_strain_rate(), oomph::PseudoBucklingRing::position(), oomph::TR::set_error_weights(), oomph::TR::set_predictor_weights(), oomph::IMR::set_weights(), oomph::IMRByBDF::set_weights(), oomph::TR::set_weights(), oomph::TR::shift_time_values(), oomph::Problem::unsteady_newton_solve(), and oomph::SegregatableFSIProblem::unsteady_segregated_solve().
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.
Set all timesteps to the same value, dt.
Definition at line 99 of file timesteppers.h.
Referenced by oomph::Problem::initialise_dt(), and oomph::Problem::initialise_dt().
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, i, and oomph::FiniteElement::size().
|
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::dump(), initialise_dt(), Time(), and time().
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().
|
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.
Referenced by oomph::Problem::shift_time_values().
|
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::Steady< NSTEPS >::assign_initial_data_values(), oomph::BDF< NSTEPS >::assign_initial_data_values(), oomph::LinearElasticityEquationsBase< DIM >::body_force(), oomph::TimeHarmonicLinearElasticityEquationsBase< DIM >::body_force(), oomph::PVDEquationsBase< DIM >::body_force(), oomph::Problem::copy(), oomph::Problem::doubly_adaptive_unsteady_newton_solve_helper(), oomph::Problem::dump(), oomph::AxisymmetricPoroelasticityTractionElement< ELEMENT >::fill_in_contribution_to_residuals_axisym_poroelasticity_face(), oomph::AxisymmetricLinearElasticityTractionElement< ELEMENT >::fill_in_contribution_to_residuals_axisymmetric_linear_elasticity_traction(), oomph::AxisymmetricNavierStokesTractionElement< ELEMENT >::fill_in_contribution_to_residuals_axisymmetric_nst_traction(), oomph::DarcyFaceElement< ELEMENT >::fill_in_contribution_to_residuals_darcy_face(), oomph::PoroelasticityFaceElement< ELEMENT >::fill_in_contribution_to_residuals_darcy_face(), oomph::LinearElasticityTractionElement< ELEMENT >::fill_in_contribution_to_residuals_linear_elasticity_traction(), oomph::AxisymmetricLinearElasticityEquations::fill_in_generic_contribution_to_residuals_axisymmetric_linear_elasticity(), oomph::AxisymmetricPoroelasticityEquations::fill_in_generic_residual_contribution(), oomph::PolarNavierStokesTractionElement< ELEMENT >::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::NavierStokesTractionElement< ELEMENT >::fill_in_generic_residual_contribution_fluid_traction(), oomph::LinearWaveEquations< DIM >::fill_in_generic_residual_contribution_lin_wave(), oomph::RefineableLinearWaveEquations< DIM >::fill_in_generic_residual_contribution_lin_wave(), oomph::LinearWaveFluxElement< ELEMENT >::fill_in_generic_residual_contribution_lin_wave_flux(), oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::fill_in_generic_residual_contribution_nst(), oomph::RefineableGeneralisedNewtonianNavierStokesEquations< DIM >::fill_in_generic_residual_contribution_nst(), oomph::NavierStokesEquations< DIM >::fill_in_generic_residual_contribution_nst(), oomph::RefineableNavierStokesEquations< DIM >::fill_in_generic_residual_contribution_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::RefineableUnsteadyHeatEquations< DIM >::fill_in_generic_residual_contribution_ust_heat(), oomph::UnsteadyHeatEquations< DIM >::fill_in_generic_residual_contribution_ust_heat(), oomph::UnsteadyHeatFluxElement< ELEMENT >::fill_in_generic_residual_contribution_ust_heat_flux(), 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::NavierStokesEquations< DIM >::get_dresidual_dnodal_coordinates(), oomph::RefineableNavierStokesEquations< DIM >::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::PseudoBucklingRing::position(), oomph::Problem::read(), oomph::RefineableNavierStokesTractionElement< ELEMENT >::refineable_fill_in_generic_residual_contribution_fluid_traction(), oomph::AxisymmetricNavierStokesTractionElement< ELEMENT >::scalar_value_paraview(), oomph::SolidICProblem::set_newmark_initial_condition_consistently(), oomph::SolidICProblem::set_newmark_initial_condition_directly(), oomph::Problem::time(), oomph::TimeStepper::time(), oomph::PeriodicOrbitEquations::time(), oomph::Problem::time(), oomph::TimeStepper::time(), oomph::Problem::unsteady_newton_solve(), oomph::Problem::unsteady_newton_solve(), oomph::SegregatableFSIProblem::unsteady_segregated_solve(), and oomph::PseudoBucklingRing::veloc().
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(), t, and oomph::StringConversion::to_string().
|
private |
Pointer to the value of the continuous time.
Definition at line 66 of file timesteppers.h.
Vector that stores the values of the current and previous timesteps.
Definition at line 69 of file timesteppers.h.
Referenced by dt(), dt(), initialise_dt(), initialise_dt(), ndt(), resize(), shift_dt(), Time(), and time().