svZeroDSolver
|
Generalized-alpha integrator. More...
#include <Integrator.h>
Public Member Functions | |
Integrator (Model *model, double time_step_size, double rho, double atol, int max_iter) | |
Construct a new Integrator object. | |
Integrator () | |
Construct a new Integrator object. | |
~Integrator () | |
Destroy the Integrator object. | |
void | clean () |
Delete dynamically allocated memory (in class member SparseSystem<double> system). | |
void | update_params (double time_step_size) |
Update integrator parameter and system matrices with model parameter updates. | |
State | step (const State &state, double time) |
Perform a time step. | |
double | avg_nonlin_iter () |
Get average number of nonlinear iterations in all step calls. | |
Generalized-alpha integrator.
This class handles the time integration scheme for solving 0D blood flow system using the generalized- method [2]. The specific implementation in this solver is based on [1] (Section 4.6.2).
We are interested in solving the DAE system defined in SparseSystem for the solutions, and , at the next time, , using the known solutions, and , at the current time, . Note that , where is the time step size.
Using the generalized- method, we launch a predictor step and a series of multi-corrector steps to solve for and . Similar to other predictor-corrector schemes, we evaluate the solutions at intermediate times between and . However, in the generalized- method, we evaluate and at different intermediate times. Specifically, we evaluate at and at , where and . Here, and are the generalized- parameters, where and . We set the default spectral radius , whereas equals the BDF2 scheme and equals the trapezoidal rule. For each time step , the procedure works as follows.
Predict the new time step based on the assumption of a constant solution and consistent time derivative :
with . We then iterate through Newton-Raphson iterations as follows, until the residual is smaller than an absolute error :
Integrator::Integrator | ( | Model * | model, |
double | time_step_size, | ||
double | rho, | ||
double | atol, | ||
int | max_iter ) |
Construct a new Integrator object.
model | The model to simulate |
time_step_size | Time step size for generalized-alpha step |
rho | Spectral radius for generalized-alpha step |
atol | Absolut tolerance for non-linear iteration termination |
max_iter | Maximum number of non-linear iterations |
Integrator::Integrator | ( | ) |
Construct a new Integrator object.
Integrator::~Integrator | ( | ) |
Destroy the Integrator object.
double Integrator::avg_nonlin_iter | ( | ) |
Get average number of nonlinear iterations in all step calls.
void Integrator::clean | ( | ) |
Delete dynamically allocated memory (in class member SparseSystem<double> system).
Perform a time step.
state | Current state |
time | Current time |
void Integrator::update_params | ( | double | time_step_size | ) |
Update integrator parameter and system matrices with model parameter updates.
time_step_size | Time step size for 0D model |