48 for(
unsigned j=0, nj=data_pt->
nvalue(); j<nj; j++)
52 for(
unsigned t=
ndt();
t>0;
t--)
65 unsigned n_dim = node_pt->
ndim();
73 double velocity[n_position_type][n_dim];
79 for(
unsigned i=0;
i<n_dim;
i++)
81 for(
unsigned k=0;k<n_position_type;k++)
86 for(
unsigned t=0;
t<n_tstorage;
t++)
95 for(
unsigned i=0;
i<n_dim;
i++)
101 for(
unsigned k=0;k<n_position_type;k++)
104 for(
unsigned t=
ndt();
t>0;
t--)
137 std::string err(
"Tried to get the temporal error from a non-adaptive");
138 err +=
" time stepper.";
139 throw OomphLibError(err, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
151 std::string err =
"This implementation of midpoint can only work with a ";
152 err +=
"single time stepper, try using IMR instead (but check ";
153 err +=
"your Jacobian and residual calculations very carefully for compatability).";
155 OOMPH_CURRENT_FUNCTION);
181 for(
unsigned i=0;
i<problem_pt->
ndof();
i++)
183 problem_pt->
dof(
i) = (problem_pt->
dof(
i) + dof_n[
i])/2;
194 for(
unsigned j=0, nj=dat_pt->
nvalue(); j<nj; j++)
197 if(update_pinned || eqn >= 0)
199 double ynp1 = 2*dat_pt->
value(0, j) - dat_pt->
value(1, j);
212 const unsigned ndof = problem_pt->
ndof();
217 for(
unsigned i=0;
i<ndof;
i++)
219 dof_np1[
i] += dof_np1[
i] - dof_n[
i];
253 using namespace StringConversion;
255 problem_pt->
get_dofs(actual_dof_np1);
257 for(
unsigned j=0; j<actual_dof_np1.
nrow(); j++)
259 if(std::abs(actual_dof_np1[j] - dof_np1[j]) > 1
e-8)
261 std::string err =
"Got different values doing midpoint update via extracted dofs than doing it in place!";
262 err +=
to_string(actual_dof_np1[j]) +
" vs " 265 OOMPH_CURRENT_FUNCTION);
virtual void set_weights()=0
Setup weights for time derivative calculations.
A Generalised Element class.
double value(const unsigned &i) const
Return i-th stored value. This function is not virtual so that it can be inlined. This means that if ...
unsigned ndt() const
Number of timestep increments that are required by the scheme.
void get_dofs(DoubleVector &dofs) const
Return the vector of dofs, i.e. a vector containing the current values of all unknowns.
void shift_time_positions(Node *const &node_pt)
This function advances the time history of the positions at a node.
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...
void actions_before_timestep(Problem *problem_pt)
Half the timestep before starting solve.
unsigned ntime_stepper() const
Return the number of time steppers.
void check_predicted_values_up_to_date() const
Check that the predicted values are the ones we want.
void post_midpoint_update(Data *dat_pt, const bool &update_pinned)
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
int Predictor_storage_index
The time-index in each Data object where predicted values are stored. -1 if not set.
Mesh *& mesh_pt()
Return a pointer to the global mesh.
long & eqn_number(const unsigned &i)
Return the equation number of the i-th stored variable.
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
unsigned long nelement() const
Return number of elements in the mesh.
bool & use_predictor_values_as_initial_guess()
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
DenseMatrix< double > Weight
Storage for the weights associated with the timestepper.
double & dof(const unsigned &i)
i-th dof in the problem
void calculate_predicted_values(Data *const &data_pt)
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
bool adaptive_flag() const
Function to indicate whether the scheme is adaptive (false by default)
void set_value(const unsigned &i, const double &value_)
Set the i-th stored data value to specified value. The only reason that we require an explicit set fu...
double & dt(const unsigned &t=0)
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
unsigned nposition_type() const
Number of coordinate types needed in the mapping between local and global coordinates.
void actions_after_timestep(Problem *problem_pt)
Time *& time_pt()
Return a pointer to the global time object.
A class that represents a collection of data; each Data object may contain many different individual ...
double & x_gen(const unsigned &k, const unsigned &i)
Reference to the generalised position x(k,i).
double & time()
Return the current value of the continuous time.
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
unsigned long ndof() const
Return the number of dofs.
unsigned long nnode() const
Return number of nodes in the mesh.
unsigned ninternal_data() const
Return the number of internal data objects.
unsigned nrow() const
access function to the number of global rows.
Time *const & time_pt() const
Access function for the pointer to time (const version)
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
Data *& global_data_pt(const unsigned &i)
Return a pointer to the the i-th global data object.
unsigned nglobal_data() const
Return the number of global data values.
virtual bool position_is_a_copy() const
Return whether any position coordinate has been copied (always false)
double temporal_error_in_value(Data *const &data_pt, const unsigned &i)
A vector in the mathematical sense, initially developed for linear algebra type applications. If MPI then this vector can be distributed - its distribution is described by the LinearAlgebraDistribution object at Distribution_pt. Data is stored in a C-style pointer vector (double*)
virtual bool is_a_copy() const
Return a boolean to indicate whether the Data objact contains any copied values. A base Data object c...
std::string to_string(T object, unsigned float_precision=8)
Conversion function that should work for anything with operator<< defined (at least all basic types)...