[petsc-users] TSMonitorSet question

Jed Brown jed at jedbrown.org
Tue May 5 14:16:30 CDT 2015


Gideon Simpson <simpson at math.drexel.edu> writes:

> Is TSMonitorSet called before or after the new time step is taken (and presumably accepted)?

I assume you mean TSMonitor.  From TSSolve:

    while (!ts->reason) {
      ierr = TSMonitor(ts,ts->steps,ts->ptime,ts->vec_sol);CHKERRQ(ierr);
      ierr = TSStep(ts);CHKERRQ(ierr);
      if (ts->event) {
	ierr = TSEventMonitor(ts);CHKERRQ(ierr);
      }
      if(!ts->steprollback) {
	ierr = TSTrajectorySet(ts->trajectory,ts,ts->steps,ts->ptime,ts->vec_sol);CHKERRQ(ierr);
	ierr = TSPostStep(ts);CHKERRQ(ierr);
      }
    }
    if (ts->exact_final_time == TS_EXACTFINALTIME_INTERPOLATE && ts->ptime > ts->max_time) {
      ierr = TSInterpolate(ts,ts->max_time,u);CHKERRQ(ierr);
      ts->solvetime = ts->max_time;
      solution = u;
    } else {
      if (u) {ierr = VecCopy(ts->vec_sol,u);CHKERRQ(ierr);}
      ts->solvetime = ts->ptime;
      solution = ts->vec_sol;
    }
    ierr = TSMonitor(ts,ts->steps,ts->solvetime,solution);CHKERRQ(ierr);
    ierr = VecViewFromOptions(solution, ((PetscObject) ts)->prefix, "-ts_view_solution");CHKERRQ(ierr);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150505/ead28a46/attachment.pgp>


More information about the petsc-users mailing list