[petsc-users] TSSetPostStep

Konstantinos Kontzialis ckontzialis at lycos.com
Sat Feb 11 07:27:48 CST 2012


Dear all,

I use the TSSetPostStep function to apply a function at the end of each 
time step.
I code the following:

     ierr = TSCreate(sys.comm, &sys.ts);
     CHKERRQ(ierr);

     ierr = TSSetApplicationContext(sys.ts, &sys);
     CHKERRQ(ierr);

     ierr = TSSetProblemType(sys.ts, TS_NONLINEAR);
     CHKERRQ(ierr);

     ierr = TSSetSolution(sys.ts, sys.gsv);
     CHKERRQ(ierr);

     ierr = TSSetPostStep(sys.ts, limiter_implicit);
     CHKERRQ(ierr);

     ierr = TSSetIFunction(sys.ts, sys.gres0, base_residual_implicit, &sys);
     CHKERRQ(ierr);

     ierr = TSGetSNES(sys.ts, &sys.snes);
     CHKERRQ(ierr);

     ierr = MatCreateSNESMF(sys.snes, &sys.J);
     CHKERRQ(ierr);

and in the function :

limiter_implicit set in TSSetPostStep I just put the command: 
puts("out\n"). But nothing prints on the the output at the end of each 
step. Any suggestions?

Kostas


More information about the petsc-users mailing list