7void NewtonBackwardEuler::f_Newton (
double *x,
double *y) {
21void NewtonBackwardEuler::J_Newton (
double *x,
double **J) {
36 for (i=0; i<
neq_; i++) {
37 for (j=0; j<
neq_; j++) {
38 J[i][j] = -dt*
Jac_[i][j];
58void OdeBackwardEuler::step_ (
double dt) {
62 for (i=0; i<
neq_; i++)
k_[0][i] = 0.0;
Nonlinear system solver for OdeBackwardEuler.
Base class implementing solver functions with adaptive time steps.
~OdeBackwardEuler()
destructs
OdeBackwardEuler(unsigned long neq)
constructs
unsigned long neq_
number of equations in the system of ODEs
std::string method_
the "name" of the solver/method, as in "Euler" or "RK4"
double * sol_
array for the solution, changing over time
Provides a large vector containing the slope values of all stages with pointers to each of the indivi...
double ** k_
individual k arrays for each stage
double ** Jac_
pointer to the solver's Jacobian matrix
void fun(double *solin, double *fout)
wrapper around system evaluation function
unsigned long neq_
ODE system size.
double * dt_
pointer to time step member
void jac(double *solin, double **Jout)
wrapper around Jacobian evaluation function
double * ftemp_
temporary values for evaluation of Newton function
double * sol_
pointer to the solver's solution vector
double * soltemp_
temporary solution values
void set_modified(bool modified)
sets whether modified Newtion's is being used
int solve_Newton(double *x)
Solve the system of equations.
bool get_modified()
gets whether modified Newtion's is being used
double ** k_
pointer to the stage slopes of RK methods