26 #ifndef OOMPH_IMPLICIT_MIDPOINT_RULE_H
27 #define OOMPH_IMPLICIT_MIDPOINT_RULE_H
52 Type =
"Midpoint method";
129 err, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
135 err, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
143 err, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
150 err, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
A class that represents a collection of data; each Data object may contain many different individual ...
void resize(const unsigned long &n)
Resize to a square nxn matrix; any values already present will be transfered.
Implicit midpoint rule base class for the two implementations.
virtual ~IMRBase()
Destructor.
void calculate_predicted_values(Data *const &data_pt)
Dummy - just check that the values that problem::calculate_predicted_values() has been called right.
void assign_initial_values_impulsive(Data *const &data_pt)
not implemented (??ds TODO)
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.
virtual void set_weights()=0
Setup weights for time derivative calculations.
void shift_time_positions(Node *const &node_pt)
This function advances the time history of the positions at a node.
void set_predictor_weights()
Set the weights for the predictor previous timestep. This is not used by midpint rule.
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.
unsigned ndt() const
Number of timestep increments that are required by the scheme.
void set_error_weights()
Set the weights for the error computation. This is not used by midpoint rule.
unsigned order() const
Actual order (accuracy) of the scheme.
virtual unsigned nprev_values_for_value_at_evaluation_time() const =0
Number of history values to interpolate over to get the "current" value.
unsigned nprev_values() const
??ds
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.
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)
void assign_initial_positions_impulsive(Node *const &node_pt)
Initialiset the positions for the node corresponding to an impulsive start.
IMRBase(const bool &adaptive=false)
Constructor with initialisation.
Implementation of implicit midpoint rule by taking half a step of bdf1 then applying an update to all...
void operator=(const IMRByBDF &dummy)
Inaccessible assignment operator.
bool Update_pinned
Should we update pinned variables after the half-step?
void actions_after_timestep(Problem *problem_pt)
Take problem from t={n+1/2} to t=n+1 by algebraic update and restore time step.
unsigned nprev_values_for_value_at_evaluation_time() const
Number of history values to interpolate over to get the "current" value. Evaluation time is the end o...
void set_weights()
Setup weights for time derivative calculations.
IMRByBDF(const IMRByBDF &dummy)
Inaccessible copy constructor.
IMRByBDF(const bool &adaptive=false)
Constructor with initialisation.
virtual ~IMRByBDF()
Destructor.
void actions_before_timestep(Problem *problem_pt)
Half the timestep before starting solve.
The "real" implementation of the implicit midpoint rule. Implemented by calculation of residuals etc....
IMR(const IMR &dummy)
Inaccessible copy constructor.
virtual ~IMR()
Destructor, predictor_pt handled by base.
void operator=(const IMR &dummy)
Inaccessible assignment operator.
unsigned nprev_values_for_value_at_evaluation_time() const
Number of history values to interpolate over to get the "current" value.
IMR(const bool &adaptive=false)
Common mistakes when using this implementation of midpoint:
void set_weights()
Setup weights for time derivative calculations.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
An OomphLibError object which should be thrown when an run-time error is encountered....
////////////////////////////////////////////////////////////////// //////////////////////////////////...
////////////////////////////////////////////////////////////////////// //////////////////////////////...
DenseMatrix< double > Weight
Storage for the weights associated with the timestepper.
bool Predict_by_explicit_step
Flag: is adaptivity done by taking a separate step using an ExplicitTimeStepper object?
Time * Time_pt
Pointer to discrete time storage scheme.
std::string Type
String that indicates the type of the timestepper (e.g. "BDF", "Newmark", etc.)
bool Is_steady
Bool to indicate if the timestepper is steady, i.e. its time-derivatives evaluate to zero....
int Predictor_storage_index
The time-index in each Data object where predicted values are stored. -1 if not set.
bool Adaptive_Flag
Boolean variable to indicate whether the timestepping scheme can be adaptive.
double & dt(const unsigned &t=0)
Return the value of the t-th stored timestep (t=0: present; t>0: previous).
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...