Skip to content

Conversation

@jorgensd
Copy link
Member

@jorgensd jorgensd commented Jun 16, 2025

If a nested preconditioner operator is passed, transfer the IS up to the outer PC object so that fieldsplit preconditioning is enabled. The field name is based off of the Function name appended with the fieldsplit index, however this is an implementation detail and users should always get the prefix rather than typing it explicitly.

Edited by @jhale.

@jorgensd jorgensd requested review from garth-wells and jhale June 16, 2025 07:59
@jorgensd jorgensd added demo New demo or demo enhancements/improvements python Pull requests that update Python code labels Jun 16, 2025
@jhale jhale changed the title Illustrate how dolfinx.fem.petsc.LinearProblem can be used with fieldsplit Improve nested fieldsplit preconditioning setup on *Problem classes Jul 3, 2025
@jhale
Copy link
Member

jhale commented Jul 3, 2025

The current implementation gives the user a fieldsplit name of e.g. sigma_0 if the DOLFINx function is named sigma and is in position 0, otherwise just 0. This is essentially the same as what is described in the PETSc documentation.

@jhale jhale added this pull request to the merge queue Jul 4, 2025
Merged via the queue into main with commit b005b93 Jul 4, 2025
28 checks passed
@jhale jhale deleted the dokken/mixed_poisson_interface branch July 4, 2025 07:35
ordinary-slim pushed a commit to ordinary-slim/dolfinx that referenced this pull request Jul 6, 2025
…FEniCS#3752)

* Use new linear-rproblem for mixed poisson

* Example of mixed poisson with fieldsplit

* Grammar - hyphen removal

* Ruff formatting

* Add suggested PETSc log printing for monitor by Nate

Co-authored-by: Nate <34454754+nate-sime@users.noreply.github.com>

* Ruff formatting

* Update demo_mixed-poisson.py

* Update demo_mixed-poisson.py

* Reformat.

* Add missing destructor for P_mat

* Transfer IS on P_mat to outer PC.

* Tweaks.

* Fix.

* Add name to Functions

* ruff

* Fix SNES.

* Without names the prefix is the same as PETSc's defaults.

* Update SNES

* Tidy.

* Add new stokes solve demo.

---------

Co-authored-by: Garth N. Wells <gnw20@cam.ac.uk>
Co-authored-by: Nate <34454754+nate-sime@users.noreply.github.com>
Co-authored-by: Jack S. Hale <mail@jackhale.co.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

demo New demo or demo enhancements/improvements python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants