26 #ifndef OOMPH_TRAPEZOID_RULE_H
27 #define OOMPH_TRAPEZOID_RULE_H
110 double dtr = dt / dtprev;
182 std::string err =
"Initial derivative of TR has not been set";
192 <<
"Solving for derivative at initial time."
193 <<
" Warning: if residual is not in the correct form this may fail."
213 unsigned n_value = data_pt->
nvalue();
220 for (
unsigned j = 0;
j < n_value;
j++)
230 double ynm1 = data_pt->
value(1,
j);
231 double yn = data_pt->
value(0,
j);
232 double fn = (2 / dtn) * (yn - ynm1) - fnm1;
241 std::cout <<
"didn't shift derivatives" << std::endl;
267 unsigned n_dim = node_pt->
ndim();
268 for (
unsigned j = 0;
j < n_dim;
j++)
274 double predicted_value = 0.0;
278 for (
unsigned i = 1;
i < 4;
i++)
293 unsigned n_value = data_pt->
nvalue();
294 for (
unsigned j = 0;
j < n_value;
j++)
301 double predicted_value = 0.0;
302 for (
unsigned i = 1;
i < 4;
i++)
int i
Definition: BiCGSTAB_step_by_step.cpp:9
void set_value(const unsigned &i, const double &value_)
Definition: nodes.h:271
virtual bool is_a_copy() const
Definition: nodes.h:253
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
Definition: nodes.h:483
double value(const unsigned &i) const
Definition: nodes.h:293
Definition: double_vector.h:58
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:1060
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
Definition: nodes.h:1054
virtual bool position_is_a_copy() const
Return whether any position coordinate has been copied (always false)
Definition: nodes.h:1113
Definition: oomph_definitions.h:222
Definition: problem.h:151
void set_dofs(const DoubleVector &dofs)
Set the values of the dofs.
Definition: problem.cc:3411
virtual void get_dvaluesdt(DoubleVector &f)
Definition: problem.cc:3684
Definition: trapezoid_rule.h:46
unsigned order() const
Return the actual order of the scheme.
Definition: trapezoid_rule.h:83
void shift_time_positions(Node *const &node_pt)
Definition: trapezoid_rule.h:257
Vector< double > Predictor_weight
Private data for the predictor weights.
Definition: trapezoid_rule.h:331
void calculate_predicted_values(Data *const &data_pt)
Function to calculate predicted data values in a Data object.
Definition: trapezoid_rule.h:290
bool Shift_f
Definition: trapezoid_rule.h:253
virtual ~TR()
Virtual destructor.
Definition: trapezoid_rule.h:80
unsigned predicted_value_index() const
Location of predicted value.
Definition: trapezoid_rule.h:142
void assign_initial_positions_impulsive(Node *const &node_pt)
Definition: trapezoid_rule.h:164
void shift_time_values(Data *const &data_pt)
Definition: trapezoid_rule.h:210
void operator=(const TR &dummy)=delete
Broken assignment operator.
double Error_weight
Private data for the error weight.
Definition: trapezoid_rule.h:334
void calculate_predicted_positions(Node *const &node_pt)
Function to calculate predicted positions at a node.
Definition: trapezoid_rule.h:264
void assign_initial_values_impulsive(Data *const &data_pt)
Definition: trapezoid_rule.h:155
void actions_before_timestep(Problem *problem_pt)
Definition: trapezoid_rule.h:177
void set_error_weights()
Definition: trapezoid_rule.h:97
void setup_initial_derivative(Problem *problem_pt)
Definition: trapezoid_rule.h:189
unsigned derivative_index(const unsigned &t) const
Location in data of derivatives.
Definition: trapezoid_rule.h:128
unsigned ndt() const
Number of timestep increments that need to be stored by the scheme.
Definition: trapezoid_rule.h:148
TR(const bool &adaptive=false)
Definition: trapezoid_rule.h:63
unsigned nprev_values() const
Number of previous values available.
Definition: trapezoid_rule.h:122
bool Initial_derivative_set
Definition: trapezoid_rule.h:251
void actions_after_timestep(Problem *problem_pt)
Definition: trapezoid_rule.h:171
double temporal_error_in_position(Node *const &node_pt, const unsigned &i)
Compute the error in the position i at a node.
Definition: trapezoid_rule.h:315
void set_predictor_weights()
Function to set the predictor weights.
Definition: trapezoid_rule.h:105
TR(const TR &dummy)=delete
Broken copy constructor.
void set_weights()
Set the weights.
Definition: trapezoid_rule.h:89
double temporal_error_in_value(Data *const &data_pt, const unsigned &i)
Compute the error in the value i in a Data structure.
Definition: trapezoid_rule.h:322
Definition: timesteppers.h:231
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
Time *const & time_pt() const
Access function for the pointer to time (const version)
Definition: timesteppers.h:572
bool Adaptive_Flag
Definition: timesteppers.h:245
double & dt(const unsigned &t=0)
Definition: timesteppers.h:136
int adaptive
Definition: jeffery_hamel.cc:106
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
OomphInfo oomph_info
Definition: oomph_definitions.cc:319
t
Definition: plotPSD.py:36
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2