[petsc-dev] 4e9ba7ee src/ts/interface/ts.c (Matthew Knepley 2014-04-08 14:37:03 -0500 2627) ierr = VecViewFromOptions(ts->vec_sol, ((PetscObject) ts)->prefix, "-ts_view_solution"); CHKERRQ(ierr);

Barry Smith bsmith at mcs.anl.gov
Sat Feb 7 11:15:11 CST 2015


> On Feb 7, 2015, at 9:08 AM, Matthew Knepley <knepley at gmail.com> wrote:
> 
> On Fri, Feb 6, 2015 at 4:00 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
> 
>   Matt,
> 
>      This line most definitively does not belong here. You are using  -xx_view option as a monitor. The -xx_view options are  only allowed after a complete solve, not while chugging along. I am removing it in master, this may break some of your stuff but you will need to fix it some other way. Something that is run every step belongs in a monitor, absolutely not in a -xx_view . Not also that users should almost never be calling TSStep(), I am changing the manual page to make that clearer.
> 
> So you want me to change -ts_view_solution to -ts_monitor_solution? Fine. Why didn't you just do that? As you may know,
> this is what all of the known scientific and engineering world does, output the solution on each timestep.

   Because there is already a call to monitor in TSSolve() (see below) and dozens of  monitors to choose from in TSSetFromOptions(). It may be that exactly the one you want is not there and needs to be added. Yes we still have on the to do list to organize the -xxx_monitor stuff properly so we don't need to manually add options to TSSetFromOptions().  The monitor does not belong in TSStep() since if the user is calling TSStep() directly themselves (which they shouldn't be in most cases) they can call whatever viewer they want themselves immediately after the call to TSStep().

 /* steps the requested number of timesteps. */
    if (ts->steps >= ts->max_steps)     ts->reason = TS_CONVERGED_ITS;
    else if (ts->ptime >= ts->max_time) ts->reason = TS_CONVERGED_TIME;
    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->event->status != TSEVENT_PROCESSING) {
	  ierr = TSPostStep(ts);CHKERRQ(ierr);
	}
      } else {
	ierr = TSPostStep(ts);CHKERRQ(ierr);
      }
    }
    if (ts->exact_final_time == TS_EXACTFINALTIME_INTERPOLATE && ts->ptime > ts

> 
>    Matt
>  
> 
>    Barry
> -- 
> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
> -- Norbert Wiener




More information about the petsc-dev mailing list