-
-
Notifications
You must be signed in to change notification settings - Fork 199
SNES solver interface for standard, block and nest systems #3648
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
Co-authored-by: Michal Habera <[email protected]>
…function for extracting Jacobians
…of `solve`. Let the user do this with the Problem-class function replace solution. Also expose the petsc objects in the solver through properties
My impression is that we should first tackle the comment made by @garth-wells https://github.com/FEniCS/dolfinx/pull/3648/files#r1973997836 in a separate PR. This can then be refactored to use #3659 which should remove many of the if statements regarding assigning functions to vectors and vice-versa. We can then think about if there are any smart ways to deal with Mat and Vec types in the SNES solver setup. |
* Unify assemble_residual * Ruff format * Fix imports * Add back comma * Move assignment of block data out of assembler * Ignore type-hints
I propose I code some further adjustments:
|
A "functional" approach to the snes problem interface.
This reduced the code to:
create_snes_solver
, that returns the the user aSNESObject
and a vector to solve intox
dolfinx.fem.Function|list[dolfinx.fem.Function
(u
) to the PETSc vector used for solving (x
)The tests now show examples of:
SNESSolver
, the highest level interfacecreate_snes_solver
, the mid-level interfacedolfinx.nls.petsc
anddolfinx.fem.petsc
to interact with your own snes solver instance.