Public Member Functions | List of all members
oomph::IMRBase Class Referenceabstract

Implicit midpoint rule base class for the two implementations. More...

#include <implicit_midpoint_rule.h>

+ Inheritance diagram for oomph::IMRBase:

Public Member Functions

 IMRBase (const bool &adaptive=false)
 Constructor with initialisation. More...
 
virtual ~IMRBase ()
 Destructor. More...
 
virtual void set_weights ()=0
 Setup weights for time derivative calculations. More...
 
virtual unsigned nprev_values_for_value_at_evaluation_time () const =0
 Number of history values to interpolate over to get the "current" value. More...
 
unsigned order () const
 Actual order (accuracy) of the scheme. More...
 
unsigned ndt () const
 Number of timestep increments that are required by the scheme. More...
 
unsigned nprev_values () const
 ??ds More...
 
void shift_time_values (Data *const &data_pt)
 This function advances the Data's time history so that we can move on to the next timestep. More...
 
void shift_time_positions (Node *const &node_pt)
 This function advances the time history of the positions at a node. More...
 
void set_error_weights ()
 Set the weights for the error computation. This is not used by midpoint rule. More...
 
void set_predictor_weights ()
 Set the weights for the predictor previous timestep. This is not used by midpint rule. More...
 
void assign_initial_values_impulsive (Data *const &data_pt)
 not implemented (??ds TODO) More...
 
void assign_initial_positions_impulsive (Node *const &node_pt)
 Initialiset the positions for the node corresponding to an impulsive start. More...
 
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...
 
double temporal_error_in_position (Node *const &node_pt, const unsigned &i)
 Compute the error in the position i at a node zero here – overwrite for specific scheme. More...
 
void calculate_predicted_values (Data *const &data_pt)
 Dummy - just check that the values that problem::calculate_predicted_values() has been called right. More...
 
double temporal_error_in_value (Data *const &data_pt, const unsigned &i)
 Compute the error in the value i in a Data structure zero here – overwrite for specific 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 &)=delete
 Broken copy constructor. More...
 
void operator= (const TimeStepper &)=delete
 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...
 
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 ()
 Get the pointer to the explicit timestepper to use as a predictor in adaptivity if Predict_by_explicit_step is set. More...
 
void set_predictor_pt (ExplicitTimeStepper *_pred_pt)
 Set the pointer to the explicit timestepper to use as a predictor in adaptivity if Predict_by_explicit_step is set. More...
 
void update_predicted_time (const double &new_time)
 Set the time that the current predictions apply for, only needed for paranoid checks when doing Predict_by_explicit_step. More...
 
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 ()
 Access function for the pointer to time (can't have a paranoid test for null pointers because this is used as a set function). More...
 
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 actions_before_timestep (Problem *problem_pt)
 Interface for any actions that need to be performed before a time step. More...
 
virtual void actions_after_timestep (Problem *problem_pt)
 Interface for any actions that need to be performed after a time step. More...
 

Additional Inherited Members

- 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
 Pointer to explicit time stepper to use as predictor if Predict_by_explicit_step is set. ??ds merge the two? predict by explicit if pointer is set? More...
 
double Predicted_time
 Store the time that the predicted values currently stored are at, to compare for paranoid checks. More...
 
int Predictor_storage_index
 The time-index in each Data object where predicted values are stored. -1 if not set. More...
 

Detailed Description

Implicit midpoint rule base class for the two implementations.

Definition at line 43 of file implicit_midpoint_rule.h.

Constructor & Destructor Documentation

◆ IMRBase()

oomph::IMRBase::IMRBase ( const bool &  adaptive = false)
inline

◆ ~IMRBase()

virtual oomph::IMRBase::~IMRBase ( )
inlinevirtual

Destructor.

Definition at line 81 of file implicit_midpoint_rule.h.

Member Function Documentation

◆ assign_initial_positions_impulsive()

void oomph::IMRBase::assign_initial_positions_impulsive ( Node *const &  node_pt)
inlinevirtual

Initialiset the positions for the node corresponding to an impulsive start.

Implements oomph::TimeStepper.

Definition at line 131 of file implicit_midpoint_rule.h.

References oomph::Global_string_for_annotation::string().

◆ assign_initial_values_impulsive()

void oomph::IMRBase::assign_initial_values_impulsive ( Data *const &  data_pt)
inlinevirtual

not implemented (??ds TODO)

Implements oomph::TimeStepper.

Definition at line 125 of file implicit_midpoint_rule.h.

References oomph::Global_string_for_annotation::string().

◆ calculate_predicted_positions()

void oomph::IMRBase::calculate_predicted_positions ( Node *const &  node_pt)
inlinevirtual

Do the predictor step for the positions at a node (currently empty — overwrite for a specific scheme)

Reimplemented from oomph::TimeStepper.

Definition at line 139 of file implicit_midpoint_rule.h.

References oomph::Global_string_for_annotation::string().

◆ calculate_predicted_values()

void oomph::IMRBase::calculate_predicted_values ( Data *const &  data_pt)
virtual

Dummy - just check that the values that problem::calculate_predicted_values() has been called right.

Reimplemented from oomph::TimeStepper.

Definition at line 111 of file implicit_midpoint_rule.cc.

References oomph::TimeStepper::adaptive_flag(), and oomph::TimeStepper::check_predicted_values_up_to_date().

◆ ndt()

unsigned oomph::IMRBase::ndt ( ) const
inlinevirtual

Number of timestep increments that are required by the scheme.

Implements oomph::TimeStepper.

Definition at line 97 of file implicit_midpoint_rule.h.

References nprev_values().

Referenced by shift_time_positions(), and shift_time_values().

◆ nprev_values()

unsigned oomph::IMRBase::nprev_values ( ) const
inlinevirtual

??ds

Implements oomph::TimeStepper.

Definition at line 103 of file implicit_midpoint_rule.h.

Referenced by ndt().

◆ nprev_values_for_value_at_evaluation_time()

virtual unsigned oomph::IMRBase::nprev_values_for_value_at_evaluation_time ( ) const
pure virtual

Number of history values to interpolate over to get the "current" value.

Reimplemented from oomph::TimeStepper.

Implemented in oomph::IMR, and oomph::IMRByBDF.

◆ order()

unsigned oomph::IMRBase::order ( ) const
inlinevirtual

Actual order (accuracy) of the scheme.

Reimplemented from oomph::TimeStepper.

Definition at line 91 of file implicit_midpoint_rule.h.

◆ set_error_weights()

void oomph::IMRBase::set_error_weights ( )
inlinevirtual

Set the weights for the error computation. This is not used by midpoint rule.

Reimplemented from oomph::TimeStepper.

Definition at line 118 of file implicit_midpoint_rule.h.

◆ set_predictor_weights()

void oomph::IMRBase::set_predictor_weights ( )
inlinevirtual

Set the weights for the predictor previous timestep. This is not used by midpint rule.

Reimplemented from oomph::TimeStepper.

Definition at line 122 of file implicit_midpoint_rule.h.

◆ set_weights()

virtual void oomph::IMRBase::set_weights ( )
pure virtual

Setup weights for time derivative calculations.

Implements oomph::TimeStepper.

Implemented in oomph::IMR, and oomph::IMRByBDF.

◆ shift_time_positions()

void oomph::IMRBase::shift_time_positions ( Node *const &  node_pt)
virtual

This function advances the time history of the positions at a node.

This function advances the time history of the positions at a node. ??ds Untested: I have no problems with moving nodes.

Implements oomph::TimeStepper.

Definition at line 57 of file implicit_midpoint_rule.cc.

References oomph::TimeStepper::adaptive_flag(), i, oomph::Node::ndim(), ndt(), oomph::Node::nposition_type(), oomph::TimeStepper::ntstorage(), oomph::Node::position_is_a_copy(), t, oomph::TimeStepper::Weight, and oomph::Node::x_gen().

◆ shift_time_values()

void oomph::IMRBase::shift_time_values ( Data *const &  data_pt)
virtual

This function advances the Data's time history so that we can move on to the next timestep.

Implements oomph::TimeStepper.

Definition at line 39 of file implicit_midpoint_rule.cc.

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

◆ temporal_error_in_position()

double oomph::IMRBase::temporal_error_in_position ( Node *const &  node_pt,
const unsigned &  i 
)
inlinevirtual

Compute the error in the position i at a node zero here – overwrite for specific scheme.

Reimplemented from oomph::TimeStepper.

Definition at line 146 of file implicit_midpoint_rule.h.

References oomph::Global_string_for_annotation::string().

◆ temporal_error_in_value()

double oomph::IMRBase::temporal_error_in_value ( Data *const &  data_pt,
const unsigned &  i 
)
virtual

Compute the error in the value i in a Data structure zero here – overwrite for specific scheme.

Reimplemented from oomph::TimeStepper.

Definition at line 122 of file implicit_midpoint_rule.cc.

References oomph::TimeStepper::adaptive_flag(), i, oomph::TimeStepper::Predictor_storage_index, oomph::Global_string_for_annotation::string(), and oomph::Data::value().


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