[petsc-users] TSSetPostStep for projected methods
Gideon Simpson
gideon.simpson at gmail.com
Sun Feb 12 11:30:15 CST 2017
I’ve begun working on implementing a projected time stepping method for solving y’ = f(y), where g(y(t)) is an invariant of the flow. Per a previous email exchange, it was suggested that I use TSSetPostStep to perform the projection routine, calling TSGetSolution obtain the current iterate, which will be corrected with the projection. However, I noticed two things:
1. The documentation for TSGetSolution says "This vector not changed until the solution at the next timestep has been calculated.” Does that mean that if I make a change to the solution in a PostStep function, it won’t be captured until the next step? What happens at the final time step?
2. The projection is nonlinear, requiring the use of a SNES. I had originally thought that I would create/configure/destroy the SNES within the main routine of the code, and pass this to the PostStep through a user data structure. However, the TSSetPostStep function seems to only take functions which are exclusively functions of the TS. Likewise, I would need to create a residual vector, r, for the SNESSetFunction. Is there a way to pass these data structures, so that they can be reused. or would they have to be created/destroyed within the PostStep function at each iterate? How costly would that be?
-gideon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170212/38bf4b33/attachment.html>
More information about the petsc-users
mailing list