About SNES solver of TS objects

tsjb00 tsjb00 at hotmail.com
Thu Sep 11 18:47:01 CDT 2008


Hi!

I use TS object to solve a non-linear problem du/dt=f(u,t). I would like to check the non-linear solver performance in TSStep. I tried to output the residuals by setting a monitor. So far my attempt didn't work. Please let me know if there are functions that calculate residuals of iterations in each TS time step. If not, how can I output the solver iteration/residuals correctly while using TS objects. 

Many thanks!

P.S. The following are the code I tried:

    PetscViewerASCIIOpen(PETSC_COMM_WORLD,"snes.log",&rviewer); 
    ierr = TSGetSNES(ts,&ts_snes);
    ierr = SNESMonitorSet(ts_snes,SNESMonitorDefault,&rviewer,PETSC_NULL);

I did get residual output in snes.log, but the format was very weird. Each line started with countless blank/space and at the very end was the SNES iteration info.  As a result, the file took a lot of memory space even with one line of outputs.

I also tried:
    PetscViewerASCIIMonitorCreate(PETSC_COMM_WORLD,"snes.log",0,&rviewer);
    ierr = TSGetSNES(ts,&ts_snes);
    ierr = SNESMonitorSet(ts_snes,SNESMonitorDefault,&rviewer,PETSC_NULL);
which didn't work at all.
_________________________________________________________________
一点即聊,MSN推出新功能“点我!”
http://im.live.cn/click/




More information about the petsc-users mailing list