30 #ifndef OOMPH_ODE_ELEMENTS_H 31 #define OOMPH_ODE_ELEMENTS_H 33 #include "../generic/oomph_definitions.h" 34 #include "../generic/oomph_utilities.h" 36 #include "../generic/matrices.h" 37 #include "../generic/Vector.h" 38 #include "../generic/elements.h" 39 #include "../generic/timesteppers.h" 63 build(time_stepper_pt, exact_solution_pt);
73 unsigned nvalue = exact.size();
102 double t = time_stepper_pt->
time();
105 for(
unsigned j=0, nj=deriv.size(); j<nj; j++)
112 residuals[j] = deriv[j] - dudt;
133 const unsigned n =
nvalue();
134 for(
unsigned i=0;
i<n;
i++)
143 (residuals, jacobian,
true);
151 for(
unsigned j=0, nj=
nvalue(); j<nj; j++)
164 OOMPH_EXCEPTION_LOCATION,
165 OOMPH_CURRENT_FUNCTION);
180 OOMPH_EXCEPTION_LOCATION,
181 OOMPH_CURRENT_FUNCTION);
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. Note that this function should NOT initialise the residuals vector or the mass matrix. It must be called after the residuals vector and jacobian matrix have been initialised to zero. The default is deliberately broken.
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 ...
virtual bool have_jacobian() const
Is a jacobian function implemented?
ODEElement()
Default constructor: null any pointers.
virtual void jacobian(const double &t, const Vector< double > &x, const Vector< double > &u, DenseMatrix< double > &jacobian) const
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...
Element for integrating an initial value ODE.
double & time()
Return current value of continous time.
void build(TimeStepper *time_stepper_pt, SolutionFunctorBase *exact_solution_pt)
Store pointers, create internal data.
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
virtual Vector< double > derivative(const double &t, const Vector< double > &x, const Vector< double > &u) const =0
Call the derivative function.
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
A class that represents a collection of data; each Data object may contain many different individual ...
Vector< double > derivative_function(const double &t, const Vector< double > &u)
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...
ODEElement(TimeStepper *time_stepper_pt, SolutionFunctorBase *exact_solution_pt)
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
Vector< double > exact_solution(const double &t) const
Exact solution.
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 ...
SolutionFunctorBase * Exact_solution_pt
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[].
virtual void fill_in_contribution_to_residuals(Vector< double > &residuals)
Get residuals.
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.