-
Notifications
You must be signed in to change notification settings - Fork 171
Add support for deflation via firedrake.DeflatedSNES #4558
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
base: main
Are you sure you want to change the base?
Conversation
The petsc4py MR is at https://gitlab.com/petsc/petsc/-/merge_requests/8701. |
The petsc4py MR has now been merged to PETSc main. |
deflation = self.deflation | ||
|
||
if self.snes.getType().startswith("vi"): | ||
vi_inact = self.snes.getVIInactiveSet() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we store this method as an attribute to avoid the weakref?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confess I don't understand. Won't that keep a strong reference?
Co-authored-by: Pablo Brubeck <[email protected]>
op = lambda x, y: inner(x - y, x - y)*dx | ||
self.op = op | ||
|
||
self.append = self.roots.append |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's convenient to have, if not necessary.
There is no documentation on how to make things work in complex mode, so I don't know where to add conjugation so that complex mode is happy.
Description
This PR adds support for deflation in Firedrake via a custom SNES solver (
firedrake.DeflatedSNES
) and an object storing the solutions to be deflated (firedrake.Deflation
). Deflation is a numerical technique for computing multiple solutions of a nonlinear problem. A general introduction to the idea can be found inhttps://pefarrell.org/files/talks/deflation.pdf
This PR adapts and updates some code I've had in defcon (https://bitbucket.org/pefarrell/defcon) for many years.
The user interface can be seen in the tests in this PR, but the basic idea is sketched below.
The VI support requires a small PR in petsc4py to wrap
SNESVIGetVariableBounds
, which I will submit presently.