dedalus icon indicating copy to clipboard operation
dedalus copied to clipboard

Add stop_iteration to NLBVP

Open bpbrown opened this issue 2 years ago • 1 comments

It would be handy to have a method for stopping NLBVP iterations if they exceed some threshold. Sometimes a NLBVP can get stuck in oscillatory non-convergent states, and a user-defined threshold could prevent a solution in that space from continuing to run.

This can be done by the user inside their main loop, but we have the concept of solver.stop_iteration for IVP, and extending this to NLBVP would keep the same approach for addressing similar situations.

Default value should probably be:

solver.stop_iteration = np.inf

to parallel IVP behaviour and current experience with NLBVP.

bpbrown avatar Jun 27 '23 04:06 bpbrown

I think the easiest thing is just to wrap this into the newton loop in the script, like:

while error > tolerance and solver.iteration < 20:
    ...

kburns avatar Jun 27 '23 14:06 kburns