[petsc-users] Setting step acceptance criteria and/or domain validity using TS module
Pierre Barbier de Reuille
pierre.barbierdereuille at gmail.com
Mon Feb 16 06:57:23 CST 2015
Hello again,
to simplify the process I created a pull request on bitbucket, only for the
domain error function (e.g. there is no change to the TSSetCheckStage
function.
Here is the link to the pull request:
https://bitbucket.org/petsc/petsc/pull-request/263
Cheers,
Pierre
On Fri Feb 13 2015 at 14:59:31 Pierre Barbier de Reuille <
pierre.barbierdereuille at gmail.com> wrote:
> Hello,
>
> sorry to bombard you with emails. But here is another patch, still on the
> master branch, which adds TSSetFunctionDomainError and
> TSFunctionDomainError functions. I tried them with Runge-Kutta and they
> work. I think I added the correct calls to all the methods, or at least all
> the ones calling TSPostStage.
>
> Note that I needed to modify the Runge-Kutta call to remove the goto. For
> some reason, on my system (Ubuntu 14.04, gcc 4.8.2), the time step would
> not get updated if compiled with optimisations. Removing the goto and
> replacing it with break/continue prevented that issue.
>
> Please tell me what you think of the modification.
>
> Cheers,
>
> Pierre
>
>
> On Thu Feb 12 2015 at 15:37:48 Pierre Barbier de Reuille <
> pierre.barbierdereuille at gmail.com> wrote:
>
>> Hello,
>>
>> so here is a patch against the MASTER branch to add time and current
>> solution vector to the TSAdaptCheckStage. What I did is add the same
>> arguments as for the TSPostStage call.
>> I hope I haven't made any mistake.
>>
>> In addition, if the stage is rejected, PETSc only tried again, changing
>> nothing, and therefore failing in the exact same way. So I also added a
>> reduction of the time step if the stage is rejected by the user.
>>
>> Note: I tested the code with the RungeKutta solver only for now.
>>
>> Cheers,
>>
>> Pierre
>>
>>
>> On Thu Feb 12 2015 at 03:45:13 Jed Brown <jed at jedbrown.org> wrote:
>>
>>> Pierre Barbier de Reuille <pierre.barbierdereuille at gmail.com> writes:
>>>
>>> > Ok, I made progress. But:
>>> >
>>> > 1 - whatever I do, I have very slightly negative values, and
>>> therefore all
>>> > my steps get rejected (values like 1e-16)
>>> > 2 - As I expected, SNES is only used with implicit methods. So if I
>>> use
>>> > explicit Runge-Kutta, then there is no solution vector stored by the
>>> SNES
>>> > object.
>>> >
>>> > Reading the code for the Runge-Kutta solver, it seems that TSPostStage
>>> is
>>> > where I can retrieve the current state, and TSAdaptCheckStage where I
>>> can
>>> > reject it. But is this something I can rely on?
>>>
>>> TSPostStage is only called *after* the stage has been accepted (the step
>>> might be rejected later, e.g., based on a local error controller).
>>>
>>> We should pass the stage solution to TSAdaptCheckStage so you can check
>>> it there. I can add this, but I'm at a conference in Singapore this
>>> week and have a couple more pressing things, so you'd have to wait until
>>> next week unless someone else can do it (or you'd like to submit a
>>> patch).
>>>
>>> We should also add TSSetSetFunctionDomainError() so you can check it
>>> there (my preference, actually).
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150216/c398706a/attachment.html>
More information about the petsc-users
mailing list