oomph::IMR Class Reference

#include <implicit_midpoint_rule.h>

+ Inheritance diagram for oomph::IMR:

Public Member Functions

 IMR (const bool &adaptive=false)
 Constructor with initialisation. More...
 
virtual ~IMR ()
 Destructor, predictor_pt handled by base. More...
 
void set_weights ()
 Setup weights for time derivative calculations. More...
 
unsigned nprev_values_for_value_at_evaluation_time () const
 
- Public Member Functions inherited from oomph::IMRBase
 IMRBase (const bool &adaptive=false)
 Constructor with initialisation. More...
 
virtual ~IMRBase ()
 Destructor. 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)
 
void shift_time_positions (Node *const &node_pt)
 
void set_error_weights ()
 
void set_predictor_weights ()
 
void assign_initial_values_impulsive (Data *const &data_pt)
 not implemented (??ds TODO) More...
 
void assign_initial_positions_impulsive (Node *const &node_pt)
 
void calculate_predicted_positions (Node *const &node_pt)
 
double temporal_error_in_position (Node *const &node_pt, const unsigned &i)
 
void calculate_predicted_values (Data *const &data_pt)
 
double temporal_error_in_value (Data *const &data_pt, const unsigned &i)
 
- Public Member Functions inherited from oomph::TimeStepper
 TimeStepper (const unsigned &tstorage, const unsigned &max_deriv)
 
 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...
 
doubletime ()
 Return current value of continous time. More...
 
double time () const
 Return current value of continous time. More...
 
void make_steady ()
 
bool is_steady () const
 
bool predict_by_explicit_step () const
 
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
 
void enable_warning_in_assign_initial_data_values ()
 
void disable_warning_in_assign_initial_data_values ()
 
const DenseMatrix< double > * weights_pt () const
 Get a (const) pointer to the weights. More...
 
virtual void undo_make_steady ()
 
std::string type () const
 
void time_derivative (const unsigned &i, Data *const &data_pt, Vector< double > &deriv)
 
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)
 
double time_derivative (const unsigned &i, Node *const &node_pt, const unsigned &j)
 
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
 
bool adaptive_flag () const
 Function to indicate whether the scheme is adaptive (false by default) More...
 
virtual void actions_before_timestep (Problem *problem_pt)
 
virtual void actions_after_timestep (Problem *problem_pt)
 

Private Member Functions

 IMR (const IMR &dummy)
 Inaccessible copy constructor. More...
 
void operator= (const IMR &dummy)
 Inaccessible assignment operator. More...
 

Additional Inherited Members

- Protected Attributes inherited from oomph::TimeStepper
TimeTime_pt
 Pointer to discrete time storage scheme. More...
 
DenseMatrix< doubleWeight
 Storage for the weights associated with the timestepper. More...
 
std::string Type
 
bool Adaptive_Flag
 
bool Is_steady
 
bool Shut_up_in_assign_initial_data_values
 
bool Predict_by_explicit_step
 
ExplicitTimeStepperExplicit_predictor_pt
 
double Predicted_time
 
int Predictor_storage_index
 

Detailed Description

The "real" implementation of the implicit midpoint rule. Implemented by calculation of residuals etc. at half step. This requires non-trivial modifications to the element's residual and Jacobian calculation functions to interpolate values to the midpoint. As such IMRByBDF should be preferred.

However this class must be used when multiple different time steppers are being used simultaneously for different parts of the problem.

Constructor & Destructor Documentation

◆ IMR() [1/2]

oomph::IMR::IMR ( const bool adaptive = false)
inline

Constructor with initialisation.

Common mistakes when using this implementation of midpoint:

  • Didn't include the d_u_evaltime_by_du_np1 term in the Jacobian.
  • Didn't properly interpolate time/values/x/derivatives in jacobian/residual (all of these MUST be evaluated at the midpoint).
176 : IMRBase(adaptive) {}
IMRBase(const bool &adaptive=false)
Constructor with initialisation.
Definition: implicit_midpoint_rule.h:47
int adaptive
Definition: jeffery_hamel.cc:106

◆ ~IMR()

virtual oomph::IMR::~IMR ( )
inlinevirtual

Destructor, predictor_pt handled by base.

179 {}

◆ IMR() [2/2]

oomph::IMR::IMR ( const IMR dummy)
inlineprivate

Inaccessible copy constructor.

205 {}

Member Function Documentation

◆ nprev_values_for_value_at_evaluation_time()

unsigned oomph::IMR::nprev_values_for_value_at_evaluation_time ( ) const
inlinevirtual

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

Implements oomph::IMRBase.

199  {
200  return 2;
201  }

◆ operator=()

void oomph::IMR::operator= ( const IMR dummy)
inlineprivate

Inaccessible assignment operator.

208 {}

◆ set_weights()

void oomph::IMR::set_weights ( )
inlinevirtual

Setup weights for time derivative calculations.

Implements oomph::IMRBase.

183  {
184  // Set the weights for zero-th derivative (i.e. the value to use in
185  // newton solver calculations, implicit midpoint method uses the
186  // average of previous and current values).
187  Weight(0, 0) = 0.5;
188  Weight(0, 1) = 0.5;
189 
190  // Set the weights for 1st time derivative
191  double dt = Time_pt->dt(0);
192  Weight(1, 0) = 1.0 / dt;
193  Weight(1, 1) = -1.0 / dt;
194  }
DenseMatrix< double > Weight
Storage for the weights associated with the timestepper.
Definition: timesteppers.h:237
Time * Time_pt
Pointer to discrete time storage scheme.
Definition: timesteppers.h:234
double & dt(const unsigned &t=0)
Definition: timesteppers.h:136

References oomph::Time::dt(), oomph::TimeStepper::Time_pt, and oomph::TimeStepper::Weight.


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