[petsc-users] Adaptive controllers in TS

Jed Brown jed at jedbrown.org
Tue Oct 28 10:03:12 CDT 2014


Miguel Angel Salazar de Troya <salazardetroya at gmail.com> writes:

> Sorry to be pushy, but could anyone help me on this?

Your last email didn't have a specific question, so I'm not sure how to
answer.  What you want to do is possible, but not trivial and might
require library modifications to avoid doing something perverse.  Hong
might be able to comment on his status or even somewhere that you could
help.

> Thanks
> Miguel
>
> On Thu, Oct 23, 2014 at 10:46 AM, Miguel Angel Salazar de Troya <
> salazardetroya at gmail.com> wrote:
>
>> I decided to implement the continuous adjoint because it is clearer to me
>> how to do it and the gradient will converge anyways. I was trying to
>> interpolate the solution, but in the adjoint analysis I need to do it once
>> the simulation has finished. I have saved all the solutions for each time
>> step. My idea was to reset the TS at the time step immediately previous to
>> the time step in which I want to interpolate to:
>>
>> interpolate_timestep : where I want to interpolate to
>> previous_timestep : last time step in our time step history which is
>> smaller that the interpolate_timestep
>> Current_Sol : Solution at the time step previous_timestep
>>
>> TSSetTime(ts,previous_timestep);
>> TSSetSolution(ts,Current_Sol);
>> TSSetRetainStages(ts,PETSC_TRUE);

Presumably this is a fragment and you did TSStep in here, otherwise how
do you expect valid stage values?

>> TSInterpolate(ts,interpolate_timestep,X);
>>
>> Vector X should have a close value to Current_Sol, but it's nowhere close.
>> I also compare it to the solution of the next time step after
>> previous_timestep (therefore interpolate_timestep is between these guys)
>> and it's not close either. I've read that TSInterpolate() has to be
>> extended to support continuous adjoints.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20141028/fba2e49b/attachment.pgp>


More information about the petsc-users mailing list