Skip to content

NonlinearProblem docstring improvements - #3765

Merged
jhale merged 17 commits into
mainfrom
jhale/post-petsc-wrapper-tidy
Jun 26, 2025
Merged

NonlinearProblem docstring improvements#3765
jhale merged 17 commits into
mainfrom
jhale/post-petsc-wrapper-tidy

Conversation

@jhale

@jhale jhale commented Jun 24, 2025

Copy link
Copy Markdown
Member
  • Improves API consistency across LinearSolver and NonlinearSolver.
  • Documentation improvements, particularly various non-obvious points.
  • Applies unique options prefixes to all held PETSc objects.
  • Explicitly points out that x (Vector solution used by KSP/SNES) and u (Function solution returned by solve).
  • Added some new property accessors.
  • petsc_options are now only applied to KSP or the SNES, not the linear algebra objects - this is made explicit in the docstring. The previous LinearSolver also applied the options to A and b, but it wasn't clear why these were not applied to x and the new P object. It's also not clear whether one would want the same options applied to multiple different linear algebra objects.

Comment thread python/dolfinx/fem/petsc.py
Comment thread python/dolfinx/fem/petsc.py Outdated
@jhale
jhale added this pull request to the merge queue Jun 26, 2025
Merged via the queue into main with commit 41a3ade Jun 26, 2025
@jhale
jhale deleted the jhale/post-petsc-wrapper-tidy branch June 26, 2025 07:20
ordinary-slim pushed a commit to ordinary-slim/dolfinx that referenced this pull request Jul 6, 2025
* Fix up doc strings.

* Fix.

* Further consistency and options safety fixes.

* Further tweaks.

* Ruff format

* More consistency fixes.

* Fix.

* More fixes.

* More use of properties internally.

* Update petsc.py

* Fix.

* Guard entire options setting process - nullop if not passed.

* Fix.

* More tweaks.

* Ruff format
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

Successfully merging this pull request may close these issues.

3 participants