[petsc-users] Spatial distribution of the residual after an implicit TS timestep

Barry Smith bsmith at mcs.anl.gov
Tue Mar 18 21:11:24 CDT 2014


On Mar 18, 2014, at 7:54 PM, Mani Chandra <mc0710 at gmail.com> wrote:

> The residual of the system of equation that I feed into TS with TSSetIFunction. I have a system of equations and I want to probe where most of the residual is coming from. The reason is that after certain time of evolution, the initial residual at the beginning of each time step increases by orders of magnitude than what it used to be at the beginning of the time step at early times. For ex, say at t=200, the SNES norm at the beginning of a TS timestep with the theta method would be something like 1.0812 and at t = 300, it would be 2e5 at the beginning. SNES then has to work much harder to reach the abs norm levels and so I want to investigate what is happening.

   So this is the initial residual in the nonlinear solve. -snes_monitor_residual works for plotting if it is 2d otherwise write your own custom SNES monitor routine and call TSGetSNES, SNESSetMonitor(). 

   Barry

> 
> 
> On Tue, Mar 18, 2014 at 7:48 PM, Jed Brown <jed at jedbrown.org> wrote:
> Mani Chandra <mc0710 at gmail.com> writes:
> 
> > Is there anyway I can get the residual at the beginning of the time step? I
> > tried TSSetPreStage and TSSetPreStep but they didn't work. Setting
> > TSSetPreStage would crash the program even if there is nothing in the
> > routine that I set and TSSetPreStep would give me the residual at the end
> > of the previous time step. I want to take a look at the residual at the
> > beginning of the new time step before the nonlinear solver starts.
> 
> Residual of what?  What are you going to do with it?
> 



More information about the petsc-users mailing list