<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Some TS methods such as TSRK do have an array of vectors like this to store the stage values. But not all TS methods have it. I am fine adding the scratch for TSTheta and any other method missing it. A little drawback is that it is used only by TSGetStages
and the TSStep implementation does not necessarily need it. So I like the idea to return a temporary array with GetStages and free it with RestoreStages when the TS method does not have an array for stages internally.
<div class=""><br class="">
</div>
<div class="">Hong<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Jan 24, 2021, at 1:08 AM, Stefano Zampini <<a href="mailto:stefano.zampini@gmail.com" class="">stefano.zampini@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">You actually do not need a RestoreStages if you use a scratch
<div class=""><br class="">
</div>
<div class="">Vec stages[2];</div>
<div class=""><br class="">
</div>
<div class="">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 class="">
<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" class="">hongzhang@anl.gov</a>> ha scritto:<br class="">
</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;" class="">
<div class="">Done. Please check <a href="https://gitlab.com/petsc/petsc/-/merge_requests/3583" target="_blank" class="">https://gitlab.com/petsc/petsc/-/merge_requests/3583</a></div>
<div class=""><br class="">
</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 class=""><br class="">
</div>
<div class="">Hong <br class="">
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On Jan 21, 2021, at 4:16 AM, Stefano Zampini <<a href="mailto:stefano.zampini@gmail.com" target="_blank" class="">stefano.zampini@gmail.com</a>> wrote:</div>
<br class="">
<div class="">
<div dir="ltr" class="">Hong,
<div class=""><br class="">
</div>
<div class="">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" class="">
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" class="">
https://gitlab.com/petsc/petsc/-/merge_requests/3500</a>
<div class="">
<div class=""><br class="">
</div>
<div class="">Now, the non-endpoint variant does no longer use th->X as stage!</div>
<div class=""><br class="">
</div>
<div class="">Please revert this change</div>
<div class="">Thanks</div>
-- <br class="">
<div dir="ltr" class="">Stefano</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</blockquote>
</div>
<br clear="all" class="">
<div class=""><br class="">
</div>
-- <br class="">
<div dir="ltr" class="gmail_signature">Stefano</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>