Advance the solution by one time step using the BDF2 (Gear) scheme.
Second-order two-step implicit formula (Gear, 1971):
Q^{n+1} = 4/3 * Q^n - 1/3 * Q^{n-1} + (2/3) * dt * R(Q^{n+1})
Solved via Newton-Raphson with the same banded-LU infrastructure as beuler_step(). LHS: A = I - (2/3)dtJ. RHS: b = (2/3)dtR(Q^k) - (Q^k - 4/3Q^n + 1/3Q^{n-1})
Bootstrap: the very first call performs one backward Euler step (A = I - dt*J, standard beuler RHS) to produce Q^1 from Q^0, storing Q^0 in state%bdf2_ub_prev so that subsequent calls can use the BDF2 formula.
The solver selection (LAPACK vs built-in) is controlled by state%cfg%lapack_solver.
WARNING: each Newton step performs (neq*n_pt + 1) residual evaluations. Use modest grid sizes (n_cell <= 200) when testing.
References: C.W. Gear, "Numerical Initial Value Problems in Ordinary Differential Equations," Prentice-Hall, 1971.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_state_t), | intent(inout) | :: | state |