forward
Stable function · Building and running
Tier: stable · Kind: function · Topic: Building and running
| Julia | Rust |
|---|---|
forward! | not exported |
Julia
forward!(run::EarthSciIntegrator.Run)
forward!(run) -> run
Run the schedule forward over the case’s interval with every leaf’s
controller on, recording the tape, a checkpoint at every macro-step boundary,
and the outputs. A non-success return code from any leaf ends the run with
that code (spec/methods.md §12), stored in run.retcode and run.failure.
Example (forward)
run = build_run(config; tspan = (0.0, 2.0))
forward!(run)
u_final = run.outputs[end][2]
# Exact solution of u' = -k u + sin(ωt), u(0) = 1.
k, ω = prob.p
A(t) = (k * sin(ω * t) - ω * cos(ω * t)) / (k^2 + ω^2)
u_exact = (1 - A(0)) * exp(-k * 2) + A(2)
@test isapprox(only(u_final), u_exact; rtol = 1e-4)
Rust
Rust does not export this function.