<div dir="ltr">Ok, it seems if I set the domain error from the rhs function, it will indeed fail and backtrack. I hope that is what was intended?<div><br>I tried before to set it in the PostStep function, but I couldn't get the current solution from there, SNESGetSolution returns an empty vector.<div><br></div><div>Cheers,</div><div><br></div><div>Pierre<br><br></div></div></div><br><div class="gmail_quote">On Tue Feb 10 2015 at 03:03:06 Jed Brown <<a href="mailto:jed@jedbrown.org">jed@jedbrown.org</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Pierre Barbier de Reuille <<a href="mailto:pierre.barbierdereuille@gmail.com" target="_blank">pierre.barbierdereuille@<u></u>gmail.com</a>> writes:<br>
<br>
> Hello,<br>
><br>
> Looking for methods to ensure negative values are rejected, I found this in<br>
> the archives:<br>
><br>
> <a href="http://lists.mcs.anl.gov/pipermail/petsc-users/2014-June/021978.html" target="_blank">http://lists.mcs.anl.gov/<u></u>pipermail/petsc-users/2014-<u></u>June/021978.html</a><br>
><br>
> The answer gives two options:<br>
> 1 - Set a function for the step acceptance criteria<br>
> 2 - Set a domain violation for the function<br>
><br>
> However, I cannot find any information on how to do either things.<br>
><br>
> For (1), I tried to use TSSetPostStep, but I couldn't figure out how to<br>
> retrieve the current solution (it seems TSGetSolution returns the last<br>
> valid solution).<br>
<br>
I would use TSAdaptSetCheckStage, but it also doesn't give you access to<br>
the stage solution, except via TSGetSNES and SNESGetSolution (which<br>
should work, but I think I should update the interface to pass in the<br>
stage solution).<br>
<br>
> For (2), I am not even sure where to start.<br>
<br>
TSGetSNES and SNESSetFunctionDomainError.<br>
</blockquote></div>