Build, review, debug, and tune PETSc-based solver workflows. Use when working with PETSc `Vec`, `Mat`, `KSP`, `PC`, `SNES`, `TS`, options-database tuning, MPI-distributed assembly, external package integration, or PETSc build and runtime failures.
Treat PETSc as a layered solver toolkit. Start from the highest-level object that matches the mathematical problem and only drop lower when there is a clear reason.
references/solver-stack-and-object-model.md before creating or repairing a PETSc-based solve path.references/ksp-and-pc-matrix.md when selecting Krylov methods, direct solves, or preconditioner families.references/snes-and-ts-patterns.md when the application is nonlinear or time-dependent.references/options-and-ksp-snes-playbook.md when translating runtime options into code or debugging prefix handling.references/runtime-option-matrix.md when selecting monitors, residual diagnostics, or common options-database switches.references/dm-and-discretization-playbook.md when DM, nullspaces, multigrid layout, or field decomposition matter.references/external-backend-matrix.md when deciding whether to route through HYPRE, direct solvers, or matrix-free paths.references/build-and-integration.md when configuring PETSc, enabling external packages, or integrating PETSc into another codebase.references/parallel-and-runtime-debugging.md when a distributed run shows assembly, ownership, convergence, or monitoring problems.references/error-recovery.md when configure, setup, or solve phases fail.KSPSNESTSVec for distributed unknownsMat or matrix-free operator for the linearizationDM when mesh, hierarchy, or field layout must drive assembly and coarseningSNES or TS already manages unless the application truly needs it.Load these on demand:
references/ksp-and-pc-matrix.md for operator-class to solver-family mappingreferences/snes-and-ts-patterns.md for nonlinear and transient workflow designreferences/runtime-option-matrix.md for monitor, logging, and option-database baselinesreferences/dm-and-discretization-playbook.md for DMDA, DMPlex, field splits, and hierarchy-aware setupreferences/external-backend-matrix.md for HYPRE, direct-solver, and matrix-free integration tradeoffsreferences/build-and-integration.md for external package wiring such as HYPRE or direct-solver backendsreferences/parallel-and-runtime-debugging.md for ownership ranges, assembly ordering, monitors, and distributed diagnosticsreferences/error-pattern-dictionary.md for fast matching of common PETSc failure classesUse assets/templates/ when a concrete starting point is faster than rebuilding the solve path from scratch, especially:
ksp_poisson_minimal.cpetsc4py_ksp_minimal.pypetsc_build_example.shpetsc_ksp_slurm.shSummarize: