libode
Easy to compile, fast ODE integrators as C++ classes
Loading...
Searching...
No Matches
ode_backward_euler.h
Go to the documentation of this file.
1#ifndef ODE_BACKWARD_EULER_H_
2#define ODE_BACKWARD_EULER_H_
3
5
6#include "ode_adaptive.h"
7#include "ode_irk.h"
8#include "ode_newton_bridge.h"
9
10namespace ode {
11
12//forward declaration to set up Newton class
13class OdeBackwardEuler;
14
16class NewtonBackwardEuler : public OdeNewtonIRK<OdeBackwardEuler> {
17 public:
19
24 NewtonBackwardEuler (unsigned long neq, unsigned long nnew, OdeBackwardEuler *integrator) : OdeNewtonIRK (neq, nnew, integrator) {};
25 private:
26 void f_Newton (double *x, double *y);
27 void J_Newton (double *x, double **J);
28};
29
31
32class OdeBackwardEuler : public OdeAdaptive, private OdeIRK {
33 //friends!
35 friend class OdeNewtonIRK<OdeBackwardEuler>;
36
37 public:
39
42 OdeBackwardEuler (unsigned long neq);
43
46
48 NewtonBackwardEuler *get_newton () { return(newton_); }
49
50 private:
51 double **a;
52 double *b;
53 NewtonBackwardEuler *newton_;
54 void step_ (double dt);
55};
56
57} // namespace ode
58
59#endif
Nonlinear system solver for OdeBackwardEuler.
NewtonBackwardEuler(unsigned long neq, unsigned long nnew, OdeBackwardEuler *integrator)
constructs
Base class implementing solver functions with adaptive time steps.
Backward Euler's method, unconditionally stable but relatively inaccurate.
OdeBackwardEuler(unsigned long neq)
constructs
NewtonBackwardEuler * get_newton()
returns a pointer to the solver's Newton system object
Provides a large vector containing the slope values of all stages with pointers to each of the indivi...
Definition ode_irk.h:9
Templated base class connecting solver objects and OdeNewton objects.
Extension of OdeNewtonBridge class for fully implicit methods.