Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

milestones #5

Closed
gdmcbain opened this issue Mar 15, 2019 · 3 comments
Closed

milestones #5

gdmcbain opened this issue Mar 15, 2019 · 3 comments

Comments

@gdmcbain
Copy link
Contributor

Would it be useful to add an optional argument to natural and euler_newton to force solution at certain values of λ ?

It's easy enough now to reproduce, as in test/test_bratu1d.py, most of the left plot in figure 1.1 of ‘Deflation techniques…’ (Farrell, Birkisson, & Funke), but not the blue or red cross at λ = 2 or the right plot with the corresponding solutions u (x; λ = 2).

scipy.integrate.solve_ivp has a couple of related features:

  • t_eval: ‘Times at which to store the computed solution’
  • events: ‘defined by a continuous function of time and state that becomes zero value in case of an event’

I envisage something like replacing

https://github.com/nschloe/pacopy/blob/1973500e422132f035fd9a419340c5100d6bb904/pacopy/natural.py#L79

with

milestone = next(milestones)
...
while ...:
    lmbda_next = lmbda + lmbda_stepsize
    if milestone < lmbda_next:
        lmbda = milestone
        milestone = next(milestones)
    else:
        lmbda = lmbda_next

plus handing:

  • lmbda_stepsize might be negative
  • milestones might be empty

The motivation is a steady Navier–Stokes solver for which the solutions are desired at certain Reynolds numbers.

@nschloe
Copy link
Collaborator

nschloe commented Mar 15, 2019

Interesting suggestion, and it's it looks certainly easy to implement. Would expect the continuation to stop once a milestone is reached, or to continue?

@gdmcbain
Copy link
Contributor Author

For natural parameter continuation, an obvious use-case is a strictly monotonic list of λ at the end of which the job's done.

In the general, e.g. arc-length, case, it's much less clear. I can't see as much practical call for milestones, except in making a figure like Farrell's, where one probably would like λ to have a nice round value to keep the caption tidy and to facilitate reproducibility. Stopping at milestones is going to be trickier when the parameter isn't monotonic. Maybe defer that case; I don't really need to reproduce figure 1.1 but do need to sweep Reynolds number.

On the question of termination, what I did to stop the 1-d Bratu arclength continuation after the curve had left the frame was raise an exception from the callback based on the norm. This sped things up a bit. kinnala/scikit-fem#126

@gdmcbain
Copy link
Contributor Author

gdmcbain commented Apr 5, 2019

I came across a good motivation for stopping at milestones in natural parameter continuation in the literature:

The backward step flow was formulated and solved as a steady flow problem. In order to obtain a solution for the specified Re of 800, a series of steady state solutions were obtained at intermediate Re-values of 200, 400 and 600. Zeroth-order continuation was used to advance from one Re solution to another. The indicated sequence of steps in Re does not represent an optimized path to the final required state but was selected for convenience and with a view towards comparing solutions at other standard conditions.

  • Gartling, D. K. (1990). A test problem for outflow boundary conditions—flow over a backward‐facing step. International Journal for Numerical Methods in Fluids, 11, 953–967. doi: 10.1002/fld.1650110704

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants