[petsc-users] TS shallow reset
Smith, Barry F.
bsmith at mcs.anl.gov
Tue Jan 7 09:14:07 CST 2020
Do you reset the initial tilmestep? Otherwise the second solve thinks it is at the end. Also you may need to reset the iteration number
Something like
ierr = TSSetTime(appctx->ts, 0);CHKERRQ(ierr);
ierr = TSSetStepNumber(appctx->ts, 0);CHKERRQ(ierr);
ierr = TSSetTimeStep(appctx->ts, appctx->initial_dt);CHKERRQ(ierr);
> On Jan 7, 2020, at 8:27 AM, Mark Adams <mfadams at lbl.gov> wrote:
>
> I would like to do a parameters study with a TS solve and want to put TSSolve in a loop. I save the initial conditions in a Vec and copy that into the solution vector after each solve, to get ready for the next one. But, TS does not seem to do anything on the second solve. I guess it thinks it is converged. Is there a way to reset the solver without redoing the whole TS?
>
> Maybe set the step number and TSSetConvergedReason?
>
> Thanks,
> Mark
More information about the petsc-users
mailing list