<div dir="ltr">You actually do not need a RestoreStages if you use a scratch<div><br></div><div>Vec stages[2];</div><div><br></div><div>in TS_theta, and pass it back with TSGetStages_Theta. I understand PETSc philosophy is that every Get should have a Restore method, but is this really necessary for TSGetStages?</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno sab 23 gen 2021 alle ore 21:05 Zhang, Hong <<a href="mailto:hongzhang@anl.gov">hongzhang@anl.gov</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="overflow-wrap: break-word;">
<div>Done. Please check <a href="https://gitlab.com/petsc/petsc/-/merge_requests/3583" target="_blank">https://gitlab.com/petsc/petsc/-/merge_requests/3583</a></div>
<div><br>
</div>
Sorry for any disturbance it caused. It was for the convenience of the adjoint implementation. The stages returned by TSGetStages_Theta currently do not reflect the true stages associated with these methods. The endpoint variant actually has two stages. This
will be changed in a separate forthcoming MR, where TSRestoreStages() will be added and TSGetStages will return an array of vectors for the endpoint variant.
<div><br>
</div>
<div>Hong <br>
<div><br>
<blockquote type="cite">
<div>On Jan 21, 2021, at 4:16 AM, Stefano Zampini <<a href="mailto:stefano.zampini@gmail.com" target="_blank">stefano.zampini@gmail.com</a>> wrote:</div>
<br>
<div>
<div dir="ltr">Hong,
<div><br>
</div>
<div>I do not understand why you changed the behavior of TSGetStages_Theta
<a href="https://gitlab.com/petsc/petsc/-/merge_requests/3500/diffs#a582bbaec75f4ae14bbf97d1d0404073ca89ff09_1194_1209" target="_blank">
https://gitlab.com/petsc/petsc/-/merge_requests/3500/diffs#a582bbaec75f4ae14bbf97d1d0404073ca89ff09_1194_1209</a> with this MR
<a href="https://gitlab.com/petsc/petsc/-/merge_requests/3500" target="_blank">https://gitlab.com/petsc/petsc/-/merge_requests/3500</a>
<div>
<div><br>
</div>
<div>Now, the non-endpoint variant does no longer use th->X as stage!</div>
<div><br>
</div>
<div>Please revert this change</div>
<div>Thanks</div>
-- <br>
<div dir="ltr">Stefano</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Stefano</div>