PETSc in a nutshell — PETSc 3.23.0 documentation

Skip to main content
`Ctrl`+`K`

# PETSc in a nutshell

See Tutorials, by Mathematical Problem to immediately jump in and run PETSc code.

PETSc/TAO is a tool for writing, analyzing, and optimizing large-scale numerical simulations.

## Algebraic objects

- Vectors - containers for simulation solutions, right-hand sides of linear systems, etc (`Vec`).

- Matrices - contain Jacobians and operators that define linear systems (`Mat`).

  - Multiple sparse and dense matrix storage formats,

  - Limited memory variable metric representations,

  - block and nested representations,

  - Easy, efficient matrix assembly and interface.

- Indices - used to access portions of vectors and matrix, for example {1,2,4} or 1:10 (`IS`).

## Solvers

- Linear solvers based on preconditioners (`PC`) and Krylov subspace methods (`KSP`).

- Nonlinear solvers (`SNES`).

- Time integrators, (ODE/PDE), explicit, implicit, IMEX, (`TS`)

  - Local and global error estimators

  - Performing sensitivity analysis with the TS ODE Solvers.

- Optimization with equality and inequality constraints, first and second order (Newton) methods (`Tao`).

- Eigenvalue/Eigenvectors and related algorithms in the package SLEPc.

## Model/Discretization Interfaces to Solvers

- Simple structured grids, `DMDA`.

- Staggered grids, DMSTAG: Staggered, Structured Grid, `DMSTAG`.

- Unstructured grids, DMPlex: Unstructured Grids, `DMPLEX`.

- Networks/graphs, for example the power grid, river networks, the nervous system, Networks, `DMNETWORK`.

- Quad or octree grids, `DMFOREST`.

- Particles, `DMSWARM`.

See also

For full feature list see:

- Vector table

- Matrix table

- Linear solvers table

- Nonlinear solvers table

- ODE integrators table

- Optimizers table

- Model/discretization interfaces to solvers table

## Utilities for Simulations/Solvers

Runtime

- control of the simulation via runtime options

- visualization of the solvers and simulation via viewers,

- monitoring of solution progress,

- profiling of the performance,

- robust error handling.