Skip to content

openseespy-solvers

openseespy-solvers provides scipy-style sparse linear and eigen solvers for OpenSeesPy PythonSparse commands.

The package wraps numerical libraries such as scipy.sparse.linalg, cupyx.scipy.sparse.linalg, and NVIDIA nvmath.sparse as solver objects. OpenSeesPy assembles the model matrices; the solver object receives those arrays, runs the selected backend, and writes results back to OpenSeesPy.

How it works

OpenSeesPy runs the analysis loop on the CPU (state determination, assembly, Newton iterations). When a linear solve is needed, it calls your PythonSparse solver with assembled buffers; GPU backends copy data to the device, solve, and copy the result back.

OpenSeesPy PythonSparse workflow with optional GPU solve

More detail on callbacks, matrix status, and what runs where: PythonSparse interface.

Start Here

In a new environment:

python -m pip install openseespy-solvers

for a default installation.

python -m pip install "openseespy-solvers[umfpack]"

for the latest UMFPACK-backed CPU direct solver (scipy.umfpack). On Windows, see UMFPACK install notes.

python -m pip install "openseespy-solvers[cuda12]"
# or
python -m pip install "openseespy-solvers[cuda13]"

if you have an NVIDIA GPU and want GPU-accelerated solvers (cupy + nvmath). Match cuda12 / cuda13 to the CUDA generation from nvidia-smi. Details: GPU install.

If you want to make sure OpenSeesPy is installed as well:

python -m pip install "openseespy-solvers[opensees]"

Then wire a solver into OpenSeesPy:

import openseespy.opensees as ops
from openseespy_solvers.scipy import spsolve

solver = spsolve()
ops.system("PythonSparse", solver.to_openseespy())

For a full model example, continue with the tutorial.

Analysis CPU NVIDIA GPU
Static or transient linear solve spsolve; umfpack for larger CPU systems direct_solver
Generalized eigen solve eigsh eigsh

For iterative solvers, preconditioners, and hybrid(), see the API overview and Tutorial.

Modules

Module Provides
scipy CPU solvers: spsolve, umfpack, cg, gmres, eigsh, lobpcg
scipy.precond CPU preconditioners: jacobi, ilu, direct
cupy GPU solvers: spsolve, cg, gmres, eigsh, lobpcg
cupy.precond GPU preconditioners: jacobi, ilu, direct
nvmath GPU direct sparse solver: direct_solver
hybrid hybrid(): direct factorization reused as a GMRES preconditioner

Constructor signatures match the underlying scipy or cupy functions where possible. The matrix and right-hand side are supplied by OpenSeesPy at solve time.

Helpful Pages

Support

Source, issues, and contributions are hosted on GitHub.