Gideon Simpson <[email protected]> writes: > In terms of the TS PreStep, PostStep, Monitor, etc., what is the calling > order? I’m specifically curious as to whether the Monitor routine is run > before or after the PostStep, but I’d be interested to know what the whole > workflow is.
Look at TSSolve:
while (!ts->reason) {
ierr = TSMonitor(ts,ts->total_steps,ts->ptime,ts->vec_sol);CHKERRQ(ierr);
if (!ts->steprollback) {
ierr = TSPreStep(ts);CHKERRQ(ierr);
}
ierr = TSStep(ts);CHKERRQ(ierr);
if (ts->vec_costintegral && ts->costintegralfwd) { /* Must evaluate the
cost integral before event is handled. The cost integral value can also be
rolled back. */
ierr = TSForwardCostIntegral(ts);CHKERRQ(ierr);
}
ierr = TSPostEvaluate(ts);CHKERRQ(ierr);
ierr = TSEventHandler(ts);CHKERRQ(ierr); /* The right-hand side may be
changed due to event. Be careful with Any computation using the RHS information
after this point. */
if (!ts->steprollback) {
ierr =
TSTrajectorySet(ts->trajectory,ts,ts->total_steps,ts->ptime,ts->vec_sol);CHKERRQ(ierr);
ierr = TSPostStep(ts);CHKERRQ(ierr);
}
}
ierr = TSMonitor(ts,ts->total_steps,ts->ptime,ts->vec_sol);CHKERRQ(ierr);
signature.asc
Description: PGP signature
