Skip to content

Improve PETSc integration - #76

Draft
max-models wants to merge 2 commits into
devel-tinyfrom
improve-petsc-integration
Draft

Improve PETSc integration#76
max-models wants to merge 2 commits into
devel-tinyfrom
improve-petsc-integration

Conversation

@max-models

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

Copy link
Copy Markdown
Member
  • Vectorize the vec_topetsc and mat_topetsc functions, this is by far the biggest bottleneck!
❯ python src/struphy/linear_algebra/petsc_solver_ill_conditioned_example.py
n=50000 dofs (1D Laplacian, condition number ~ O(n^2))
  cg (unpreconditioned) :  15407.14 ms, niter=49489
  petsc (cg + gamg)     :    357.01 ms, niter=16
  speedup: 43.16x
  ||x_cg - x_exact||    = 4.244e-03
  ||x_petsc - x_exact|| = 4.005e-06

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