Public Types | Public Member Functions | Protected Attributes | List of all members
oomph::Newmark< NSTEPS > Class Template Reference

Newmark scheme for second time deriv. Stored data represents. More...

#include <timesteppers.h>

+ Inheritance diagram for oomph::Newmark< NSTEPS >:

Public Types

typedef double(* InitialConditionFctPt )(const double &t)
 Typedef for function that returns the (scalar) initial value at a given value of the continuous time t. More...
 
typedef double(* NodeInitialConditionFctPt )(const double &t, const Vector< double > &x)
 Typedef for function that returns the (scalar) initial value at a given value of the continuous time t and the spatial coordinate – appropriate for assignement of initial conditions for nodes. More...
 

Public Member Functions

 Newmark ()
 Constructor: Pass pointer to global time. We set up a timestepping scheme with NSTEPS+2 doubles to represent the history and the highest deriv is 2. More...
 
 Newmark (const Newmark &)
 Broken copy constructor. More...
 
void operator= (const Newmark &)
 Broken assignment operator. More...
 
unsigned order () const
 The actual order (accuracy of the scheme) More...
 
void assign_initial_values_impulsive (Data *const &data_pt)
 Initialise the time-history for the values, corresponding to an impulsive start. More...
 
void assign_initial_positions_impulsive (Node *const &node_pt)
 Initialise the time-history for the values, corresponding to an impulsive start. More...
 
void assign_initial_data_values (Data *const &data_pt, Vector< InitialConditionFctPt > initial_value_fct, Vector< InitialConditionFctPt > initial_veloc_fct, Vector< InitialConditionFctPt > initial_accel_fct)
 Initialise the time-history for the Data values, so that the Newmark representations for current veloc and acceleration are exact. More...
 
void assign_initial_data_values (Node *const &node_pt, Vector< NodeInitialConditionFctPt > initial_value_fct, Vector< NodeInitialConditionFctPt > initial_veloc_fct, Vector< NodeInitialConditionFctPt > initial_accel_fct)
 Initialise the time-history for the nodal values, so that the Newmark representations for current veloc and acceleration are exact. More...
 
void assign_initial_data_values_stage1 (const unsigned t_deriv, Data *const &data_pt)
 First step in a two-stage procedure to assign the history values for the Newmark scheme so that the veloc and accel that are computed by the scheme are correct at the current time. More...
 
void assign_initial_data_values_stage2 (Data *const &data_pt)
 Second step in a two-stage procedure to assign the history values for the Newmark scheme so that the veloc and accel that are computed by the scheme are correct at the current time. More...
 
void shift_time_values (Data *const &data_pt)
 This function updates the Data's time history so that we can advance to the next timestep. More...
 
void shift_time_positions (Node *const &node_pt)
 This function updates a nodal time history so that we can advance to the next timestep. More...
 
void set_weights ()
 Set weights. More...
 
unsigned nprev_values () const
 Number of previous values available. More...
 
unsigned ndt () const
 Number of timestep increments that need to be stored by the scheme. More...
 
- Public Member Functions inherited from oomph::TimeStepper
 TimeStepper (const unsigned &tstorage, const unsigned &max_deriv)
 Constructor. Pass the amount of storage required by timestepper (present value + history values) and the order of highest time-derivative. More...
 
 TimeStepper ()
 Broken empty constructor. More...
 
 TimeStepper (const TimeStepper &)
 Broken copy constructor. More...
 
void operator= (const TimeStepper &)
 Broken assignment operator. More...
 
virtual ~TimeStepper ()
 virtual destructor More...
 
unsigned highest_derivative () const
 Highest order derivative that the scheme can compute. More...
 
double & time ()
 Return current value of continous time. More...
 
double time () const
 Return current value of continous time. More...
 
virtual unsigned nprev_values_for_value_at_evaluation_time () const
 Number of previous values needed to calculate the value at the current time. i.e. how many previous values must we loop over to calculate the values at the evaluation time. For most methods this is 1, i.e. just use the value at t_{n+1}. See midpoint method for a counter-example. More...
 
void make_steady ()
 Function to make the time stepper temporarily steady. This is trivially achieved by setting all the weights to zero. More...
 
bool is_steady () const
 Flag to indicate if a timestepper has been made steady (possibly temporarily to switch off time-dependence) More...
 
bool predict_by_explicit_step () const
 Flag: is adaptivity done by taking a separate step using an ExplicitTimeStepper object? More...
 
ExplicitTimeStepperexplicit_predictor_pt ()
 
void set_predictor_pt (ExplicitTimeStepper *_pred_pt)
 
void update_predicted_time (const double &new_time)
 
void check_predicted_values_up_to_date () const
 Check that the predicted values are the ones we want. More...
 
unsigned predictor_storage_index () const
 Return the time-index in each Data where predicted values are stored if the timestepper is adaptive. More...
 
void enable_warning_in_assign_initial_data_values ()
 Enable the output of warnings due to possible fct pointer vector size mismatch in assign_initial_data_values (Default) More...
 
void disable_warning_in_assign_initial_data_values ()
 Disable the output of warnings due to possible fct pointer vector size mismatch in assign_initial_data_values. More...
 
const DenseMatrix< double > * weights_pt () const
 Get a (const) pointer to the weights. More...
 
virtual void undo_make_steady ()
 Reset the is_steady status of a specific TimeStepper to its default and re-assign the weights. More...
 
std::string type () const
 Return string that indicates the type of the timestepper (e.g. "BDF", "Newmark", etc.) More...
 
void time_derivative (const unsigned &i, Data *const &data_pt, Vector< double > &deriv)
 Evaluate i-th derivative of all values in Data and return in Vector deriv[]. More...
 
double time_derivative (const unsigned &i, Data *const &data_pt, const unsigned &j)
 Evaluate i-th derivative of j-th value in Data. More...
 
void time_derivative (const unsigned &i, Node *const &node_pt, Vector< double > &deriv)
 Evaluate i-th derivative of all values in Node and return in Vector deriv[] (this can't be simply combined with time_derivative(.., Data, ...) because of differences with haning nodes). More...
 
double time_derivative (const unsigned &i, Node *const &node_pt, const unsigned &j)
 Evaluate i-th derivative of j-th value in Node. Note the use of the node's value() function so that hanging nodes are taken into account (this is why the functions for Data and Node cannot be combined through simple polymorphism: value is not virtual). More...
 
Time *const & time_pt () const
 Access function for the pointer to time (const version) More...
 
Time *& time_pt ()
 
virtual double weight (const unsigned &i, const unsigned &j) const
 Access function for j-th weight for the i-th derivative. More...
 
unsigned ntstorage () const
 Return the number of doubles required to represent history (one for steady) More...
 
bool adaptive_flag () const
 Function to indicate whether the scheme is adaptive (false by default) More...
 
virtual void set_predictor_weights ()
 Set the weights for the predictor previous timestep (currently empty – overwrite for specific scheme) More...
 
virtual void calculate_predicted_values (Data *const &data_pt)
 Do the predictor step for data stored in a Data object (currently empty – overwrite for specific scheme) More...
 
virtual void calculate_predicted_positions (Node *const &node_pt)
 Do the predictor step for the positions at a node (currently empty — overwrite for a specific scheme) More...
 
virtual void set_error_weights ()
 Set the weights for the error computation, (currently empty – overwrite for specific scheme) More...
 
virtual double temporal_error_in_position (Node *const &node_pt, const unsigned &i)
 
virtual double temporal_error_in_value (Data *const &data_pt, const unsigned &i)
 
virtual void actions_before_timestep (Problem *problem_pt)
 
virtual void actions_after_timestep (Problem *problem_pt)
 

Protected Attributes

double Beta1
 First Newmark parameter (usually 0.5) More...
 
double Beta2
 Second Newmark parameter (usually 0.5) More...
 
- Protected Attributes inherited from oomph::TimeStepper
TimeTime_pt
 Pointer to discrete time storage scheme. More...
 
DenseMatrix< double > Weight
 Storage for the weights associated with the timestepper. More...
 
std::string Type
 String that indicates the type of the timestepper (e.g. "BDF", "Newmark", etc.) More...
 
bool Adaptive_Flag
 Boolean variable to indicate whether the timestepping scheme can be adaptive. More...
 
bool Is_steady
 Bool to indicate if the timestepper is steady, i.e. its time-derivatives evaluate to zero. This status may be achieved temporarily by calling make_steady(). It can be reset to the appropriate default by the function undo_make_steady(). More...
 
bool Shut_up_in_assign_initial_data_values
 Boolean to indicate if the timestepper will output warnings when setting possibly an incorrect number of initial data values from function pointers. More...
 
bool Predict_by_explicit_step
 Flag: is adaptivity done by taking a separate step using an ExplicitTimeStepper object? More...
 
ExplicitTimeStepperExplicit_predictor_pt
 
double Predicted_time
 
int Predictor_storage_index
 The time-index in each Data object where predicted values are stored. -1 if not set. More...
 

Detailed Description

template<unsigned NSTEPS>
class oomph::Newmark< NSTEPS >

Newmark scheme for second time deriv. Stored data represents.

NSTEPS=1 gives normal Newmark.

Definition at line 868 of file timesteppers.h.

Member Typedef Documentation

template<unsigned NSTEPS>
typedef double(* oomph::Newmark< NSTEPS >::InitialConditionFctPt)(const double &t)

Typedef for function that returns the (scalar) initial value at a given value of the continuous time t.

Definition at line 920 of file timesteppers.h.

template<unsigned NSTEPS>
typedef double(* oomph::Newmark< NSTEPS >::NodeInitialConditionFctPt)(const double &t, const Vector< double > &x)

Typedef for function that returns the (scalar) initial value at a given value of the continuous time t and the spatial coordinate – appropriate for assignement of initial conditions for nodes.

Definition at line 938 of file timesteppers.h.

Constructor & Destructor Documentation

template<unsigned NSTEPS>
oomph::Newmark< NSTEPS >::Newmark ( )
inline

Constructor: Pass pointer to global time. We set up a timestepping scheme with NSTEPS+2 doubles to represent the history and the highest deriv is 2.

Definition at line 876 of file timesteppers.h.

template<unsigned NSTEPS>
oomph::Newmark< NSTEPS >::Newmark ( const Newmark< NSTEPS > &  )
inline

Broken copy constructor.

Definition at line 886 of file timesteppers.h.

References oomph::BrokenCopy::broken_copy().

Member Function Documentation

template<unsigned NSTEPS>
void oomph::Newmark< NSTEPS >::assign_initial_data_values ( Data *const &  data_pt,
Vector< InitialConditionFctPt initial_value_fct,
Vector< InitialConditionFctPt initial_veloc_fct,
Vector< InitialConditionFctPt initial_accel_fct 
)

Initialise the time-history for the Data values, so that the Newmark representations for current veloc and acceleration are exact.

Definition at line 580 of file timesteppers.cc.

References oomph::Data::nvalue(), oomph::Data::set_value(), oomph::DoubleMatrixBase::solve(), t, and oomph::OcTreeNames::U.

template<unsigned NSTEPS>
void oomph::Newmark< NSTEPS >::assign_initial_data_values ( Node *const &  node_pt,
Vector< NodeInitialConditionFctPt initial_value_fct,
Vector< NodeInitialConditionFctPt initial_veloc_fct,
Vector< NodeInitialConditionFctPt initial_accel_fct 
)

Initialise the time-history for the nodal values, so that the Newmark representations for current veloc and acceleration are exact.

Initialise the time-history for the Data values, so that the Newmark representations for current veloc and acceleration are exact.

Definition at line 703 of file timesteppers.cc.

References i, oomph::Node::ndim(), oomph::Data::nvalue(), oomph::Data::set_value(), oomph::DoubleMatrixBase::solve(), t, oomph::OcTreeNames::U, and oomph::Node::x().

template<unsigned NSTEPS>
void oomph::Newmark< NSTEPS >::assign_initial_data_values_stage1 ( const unsigned  t_deriv,
Data *const &  data_pt 
)

First step in a two-stage procedure to assign the history values for the Newmark scheme so that the veloc and accel that are computed by the scheme are correct at the current time.

Call this function for t_deriv=0,1,2,3. When calling with

  • t_deriv=0 : data_pt(0,*) should contain the values at the previous timestep
  • t_deriv=1 : data_pt(0,*) should contain the current values; they get stored (temporarily) in data_pt(1,*).
  • t_deriv=2 : data_pt(0,*) should contain the current velocities (first time derivs); they get stored (temporarily) in data_pt(NSTEPS+1,*).
  • t_deriv=3 : data_pt(0,*) should contain the current accelerations (second time derivs); they get stored (temporarily) in data_pt(NSTEPS+2,*).

Follow this by calls to

Definition at line 847 of file timesteppers.cc.

References oomph::Data::nvalue(), oomph::Data::set_value(), and oomph::Data::value().

template<unsigned NSTEPS>
void oomph::Newmark< NSTEPS >::assign_initial_data_values_stage2 ( Data *const &  data_pt)

Second step in a two-stage procedure to assign the history values for the Newmark scheme so that the veloc and accel that are computed by the scheme are correct at the current time.

This assigns appropriate values for the "previous velocities and accelerations" so that their current values, which were defined in assign_initial_data_values_stage1(...), are represented exactly by the Newmark scheme.

Definition at line 907 of file timesteppers.cc.

References oomph::Data::nvalue(), oomph::Data::set_value(), oomph::DoubleMatrixBase::solve(), oomph::OcTreeNames::U, and oomph::Data::value().

template<unsigned NSTEPS>
void oomph::Newmark< NSTEPS >::assign_initial_positions_impulsive ( Node *const &  node_pt)
virtual

Initialise the time-history for the values, corresponding to an impulsive start.

Implements oomph::TimeStepper.

Definition at line 542 of file timesteppers.cc.

References i, oomph::Node::ndim(), oomph::Node::nposition_type(), oomph::Node::position_is_a_copy(), t, and oomph::Node::x_gen().

template<unsigned NSTEPS>
void oomph::Newmark< NSTEPS >::assign_initial_values_impulsive ( Data *const &  data_pt)
virtual

Initialise the time-history for the values, corresponding to an impulsive start.

Implements oomph::TimeStepper.

Definition at line 513 of file timesteppers.cc.

References oomph::Data::is_a_copy(), oomph::Data::nvalue(), oomph::Data::set_value(), t, and oomph::Data::value().

template<unsigned NSTEPS>
unsigned oomph::Newmark< NSTEPS >::ndt ( ) const
inlinevirtual

Number of timestep increments that need to be stored by the scheme.

Implements oomph::TimeStepper.

Definition at line 1004 of file timesteppers.h.

template<unsigned NSTEPS>
unsigned oomph::Newmark< NSTEPS >::nprev_values ( ) const
inlinevirtual

Number of previous values available.

Implements oomph::TimeStepper.

Definition at line 1001 of file timesteppers.h.

template<unsigned NSTEPS>
void oomph::Newmark< NSTEPS >::operator= ( const Newmark< NSTEPS > &  )
inline

Broken assignment operator.

Definition at line 892 of file timesteppers.h.

References oomph::BrokenCopy::broken_assign().

template<unsigned NSTEPS>
unsigned oomph::Newmark< NSTEPS >::order ( ) const
inlinevirtual

The actual order (accuracy of the scheme)

Reimplemented from oomph::TimeStepper.

Definition at line 899 of file timesteppers.h.

References oomph::Global_string_for_annotation::string().

template<unsigned NSTEPS>
void oomph::Newmark< NSTEPS >::set_weights ( )
virtual

Set weights.

Implements oomph::TimeStepper.

Reimplemented in oomph::NewmarkBDF< NSTEPS >, oomph::NewmarkBDF< NSTEPS >, oomph::NewmarkBDF< NSTEPS >, and oomph::NewmarkBDF< NSTEPS >.

Definition at line 1059 of file timesteppers.cc.

References t.

template<unsigned NSTEPS>
void oomph::Newmark< NSTEPS >::shift_time_positions ( Node *const &  node_pt)
virtual

This function updates a nodal time history so that we can advance to the next timestep.

Implements oomph::TimeStepper.

Reimplemented in oomph::NewmarkBDF< NSTEPS >.

Definition at line 1003 of file timesteppers.cc.

References i, oomph::Node::ndim(), oomph::Node::nposition_type(), oomph::Node::position_is_a_copy(), t, and oomph::Node::x_gen().

template<unsigned NSTEPS>
void oomph::Newmark< NSTEPS >::shift_time_values ( Data *const &  data_pt)
virtual

This function updates the Data's time history so that we can advance to the next timestep.

Implements oomph::TimeStepper.

Reimplemented in oomph::NewmarkBDF< NSTEPS >.

Definition at line 970 of file timesteppers.cc.

References oomph::Data::is_a_copy(), oomph::Data::nvalue(), oomph::Data::set_value(), t, and oomph::Data::value().

Member Data Documentation

template<unsigned NSTEPS>
double oomph::Newmark< NSTEPS >::Beta1
protected

First Newmark parameter (usually 0.5)

Definition at line 1010 of file timesteppers.h.

template<unsigned NSTEPS>
double oomph::Newmark< NSTEPS >::Beta2
protected

Second Newmark parameter (usually 0.5)

Definition at line 1013 of file timesteppers.h.


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