svZeroDSolver
Loading...
Searching...
No Matches
Integrator Class Reference

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.
 

Detailed Description

Generalized-alpha integrator.

This class handles the time integration scheme for solving 0D blood flow system using the generalized- $\alpha$ 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, $\mathbf{y}_{n+1}$ and $\dot{\mathbf{y}}_{n+1}$, at the next time, $t_{n+1}$, using the known solutions, $\mathbf{y}_{n}$ and $\dot{\mathbf{y}}_{n}$, at the current time, $t_{n}$. Note that $t_{n+1} = t_{n} + \Delta t$, where $\Delta t$ is the time step size.

Using the generalized- $\alpha$ method, we launch a predictor step and a series of multi-corrector steps to solve for $\mathbf{y}_{n+1}$ and $\dot{\mathbf{y}}_{n+1}$. Similar to other predictor-corrector schemes, we evaluate the solutions at intermediate times between $t_{n}$ and $t_{n + 1}$. However, in the generalized- $\alpha$ method, we evaluate $\mathbf{y}$ and $\dot{\mathbf{y}}$ at different intermediate times. Specifically, we evaluate $\mathbf{y}$ at $t_{n+\alpha_{f}}$ and $\dot{\mathbf{y}}$ at $t_{n+\alpha_{m}}$, where $t_{n+\alpha_{f}} = t_{n} +
\alpha_{f}\Delta t$ and $t_{n+\alpha_{m}} = t_{n} + \alpha_{m}\Delta
t$. Here, $\alpha_{m}$ and $\alpha_{f}$ are the generalized- $\alpha$ parameters, where $\alpha_{m} = \frac{3 - \rho}{2
+ 2\rho}$ and $\alpha_{f} = \frac{1}{1 + \rho}$. We set the default spectral radius $\rho=0.5$, whereas $\rho=0.0$ equals the BDF2 scheme and $\rho=1.0$ equals the trapezoidal rule. For each time step $n$, the procedure works as follows.

Predict the new time step based on the assumption of a constant solution $\mathbf{y}$ and consistent time derivative $\dot{\mathbf{y}}$:

\[ \dot{\mathbf y}_{n+1}^0 = \frac{\gamma-1}{\gamma}
\dot{\mathbf y}_n, \]

\[ \mathbf y_{n+1}^0 = \mathbf y_n. \]

with $\gamma = \frac{1}{2} + \alpha_m - \alpha_f$. We then iterate through Newton-Raphson iterations $i$ as follows, until the residual is smaller than an absolute error $||\mathbf r||_\infty < \epsilon_\text{abs}$:

  1. Initiate the iterates at the intermediate time levels:

    \[
\dot{\mathbf y}_{n+\alpha_m}^i = \dot{\mathbf y}_n + \alpha_m \left(
\dot{\mathbf y}_{n+1}^i - \dot{\mathbf y}_n  \right),
\]

    \[
\mathbf y_{n+\alpha_f}^i= \mathbf y_n + \alpha_f \left( \mathbf y_{n+1}^i -
\mathbf y_n \right).
\]

  2. Solve for the increment $\Delta\dot{\mathbf{y}}$ in the linear system:

    \[
\mathbf K(\mathbf y_{n+\alpha_f}^i, \dot{\mathbf y}_{n+\alpha_m}^i) \cdot
\Delta \dot{\mathbf y}_{n+1}^i = - \mathbf r(\mathbf y_{n+\alpha_f}^i,
\dot{\mathbf y}_{n+\alpha_m}^i).
\]

  3. Update the solution vectors:

    \[
\dot{\mathbf y}_{n+1}^{i+1} = \dot{\mathbf y}_{n+1}^i + \Delta
\dot{\mathbf y}_{n+1}^i,
\]

    \[
\mathbf y_{n+1}^{i+1} = \mathbf y_{n+1}^i + \Delta \dot{\mathbf y}_{n+1}^i
\gamma \Delta t_n.
\]

Constructor & Destructor Documentation

◆ Integrator() [1/2]

Integrator::Integrator ( Model * model,
double time_step_size,
double rho,
double atol,
int max_iter )

Construct a new Integrator object.

Parameters
modelThe model to simulate
time_step_sizeTime step size for generalized-alpha step
rhoSpectral radius for generalized-alpha step
atolAbsolut tolerance for non-linear iteration termination
max_iterMaximum number of non-linear iterations

◆ Integrator() [2/2]

Integrator::Integrator ( )

Construct a new Integrator object.

◆ ~Integrator()

Integrator::~Integrator ( )

Destroy the Integrator object.

Member Function Documentation

◆ avg_nonlin_iter()

double Integrator::avg_nonlin_iter ( )

Get average number of nonlinear iterations in all step calls.

Returns
Average number of nonlinear iterations in all step calls

◆ clean()

void Integrator::clean ( )

Delete dynamically allocated memory (in class member SparseSystem<double> system).

◆ step()

State Integrator::step ( const State & state,
double time )

Perform a time step.

Parameters
stateCurrent state
timeCurrent time
Returns
New state

◆ update_params()

void Integrator::update_params ( double time_step_size)

Update integrator parameter and system matrices with model parameter updates.

Parameters
time_step_sizeTime step size for 0D model

The documentation for this class was generated from the following files: