Skip to content

Add basic building blocks for a PETSc solver - #334

Draft
max-models wants to merge 34 commits into
develfrom
add-petsc-solver
Draft

Add basic building blocks for a PETSc solver#334
max-models wants to merge 34 commits into
develfrom
add-petsc-solver

Conversation

@max-models

@max-models max-models commented Aug 6, 2026

Copy link
Copy Markdown
Member

This is a redo of some of the PETSc testing I did long ago.

Since psydac has a mat_topetsc() and vec_topetsc(), using petsc for at least some solves should be pretty straightforward.

Todo:

  • Create a PETScSolver class
  • Create an abstract solver class
  • Support mass matrix solves
  • Full support, including composed operators
  • Integration in the struphy models
  • Integration via struphy simulation API

Notes

  • No speedup with petsc for the mass-matrix case, feectools' compiled matvec is cheap enough that even tens of thousands of extra CG iterations stay cheaper than PETSc's one-time GAMG setup + per-solve Python-level vector conversion. Maybe if the same matrix is solved repeatedly with different right-hand sides, PETSc only pays the GAMG setup cost once.

@max-models
max-models marked this pull request as draft August 10, 2026 20:31
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.

1 participant