26 #ifndef OOMPH_ODE_ELEMENTS_H
27 #define OOMPH_ODE_ELEMENTS_H
29 #include "../generic/oomph_definitions.h"
30 #include "../generic/oomph_utilities.h"
32 #include "../generic/matrices.h"
33 #include "../generic/Vector.h"
34 #include "../generic/elements.h"
35 #include "../generic/timesteppers.h"
56 build(time_stepper_pt, exact_solution_pt);
66 unsigned nvalue = exact.size();
95 double t = time_stepper_pt->
time();
98 for (
unsigned j = 0, nj = deriv.size(); j < nj; j++)
105 residuals[j] = deriv[j] - dudt;
126 const unsigned n =
nvalue();
127 for (
unsigned i = 0;
i < n;
i++)
136 residuals, jacobian,
true);
144 for (
unsigned j = 0, nj =
nvalue(); j < nj; j++)
157 OOMPH_EXCEPTION_LOCATION,
158 OOMPH_CURRENT_FUNCTION);
172 OOMPH_EXCEPTION_LOCATION,
173 OOMPH_CURRENT_FUNCTION);
A class that represents a collection of data; each Data object may contain many different individual ...
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
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 ...
A Generalised Element class.
void fill_in_jacobian_from_internal_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
Calculate the contributions to the jacobian from the internal degrees of freedom using finite differe...
unsigned add_internal_data(Data *const &data_pt, const bool &fd=true)
Add a (pointer to an) internal data object to the element and return the index required to obtain it ...
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
Element for integrating an initial value ODE.
ODEElement(TimeStepper *time_stepper_pt, SolutionFunctorBase *exact_solution_pt)
Constructor: Pass time stepper and a solution function pointer, then build the element.
Vector< double > exact_solution(const double &t) const
Exact solution.
virtual void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Add the elemental contribution to the jacobian matrix. and the residuals vector. Note that this funct...
SolutionFunctorBase * Exact_solution_pt
ODEElement()
Default constructor: null any pointers.
Vector< double > derivative_function(const double &t, const Vector< double > &u)
Exact solution.
virtual void fill_in_contribution_to_residuals(Vector< double > &residuals)
Get residuals.
void build(TimeStepper *time_stepper_pt, SolutionFunctorBase *exact_solution_pt)
Store pointers, create internal data.
virtual void fill_in_contribution_to_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &mm)
Add the elemental contribution to the mass matrix matrix. and the residuals vector....
An OomphLibError object which should be thrown when an run-time error is encountered....
Function base class for exact solutions/initial conditions/boundary conditions. This is needed so tha...
virtual void jacobian(const double &t, const Vector< double > &x, const Vector< double > &u, DenseMatrix< double > &jacobian) const
The derivatives of the derivative function with respect to u (note that this is not quite the jacobia...
virtual Vector< double > derivative(const double &t, const Vector< double > &x, const Vector< double > &u) const =0
Call the derivative function.
virtual bool have_jacobian() const
Is a jacobian function implemented?
////////////////////////////////////////////////////////////////////// //////////////////////////////...
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
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[].
double & time()
Return current value of continous time.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...