[petsc-users] Call KSP routine before each timestep

Scott Dossa doss0032 at umn.edu
Mon May 1 15:13:31 CDT 2017


Hi All,

I'm looking to pass a vector between a KSP and TS routine. The KSP routine
must be called before each timestep, and the solution vector is needed for
the TS routine. Normally, TSSolve() runs over all timesteps, but in my
case, I'd like to be able to add a routine before each timestep.

Can someone direct me to an example script or briefly explain a case which
shows how to control time stepping such that one could achieve something
along the lines of:

while (step < maxsteps+1){
        KSPSolve(ksp, v, p); /* solves for Vec p and passes this info onto
TS */
        TSSolve(ts, u); /* only iterate for 1 timestep */
}

The function TSSetPreStep() seemed promising, but it can only take TS as
arguments which may not be sufficient to pass a global vector.

Thank you in advance.
Scott Dossa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170501/3df69425/attachment.html>


More information about the petsc-users mailing list