Skip to main content

Ready-to-use, SciPy-style PythonSparse solvers for OpenSeesPy

Project description

openseespy-solvers

Sparse linear algebra solvers for OpenSeesPy PythonSparse commands.

Documentation: openseespy-solvers.readthedocs.io

Installation

Requires Python ≥ 3.12, NumPy ≥ 1.26, SciPy ≥ 1.12, and serial OpenSeesPy (parallel/MPI OpenSeesPy builds are not supported — see docs).

Full setup from scratch

Copy-paste overview — see the installation guide for platform notes (UMFPACK, GPU wheels) and the complete verification checklist.

# 1. Environment (conda or venv — all platforms)
conda create -n openseespy-solvers python=3.12 -y
conda activate openseespy-solvers

# 2. Clone (examples and pytest are in the repo, not the pip wheel)
git clone https://github.com/gaaraujo/openseespy-solvers.git
cd openseespy-solvers

# 3. Install
pip install -e ".[dev,opensees]"

# 4–5. Optional backends — UMFPACK, CuPy, nvMath (see installation guide)
# 6. pip check
# 7. Verify
pytest
cd examples && python solvers/scipy_spsolve.py && python solvers/scipy_eigsh.py
python brick_bar.py && python brick_bar_eigen.py

GPU tests in pytest run when CuPy/nvMath are installed; skipped otherwise.

Quick install (library only)

pip install openseespy-solvers
pip install openseespy-solvers[opensees]   # if OpenSeesPy is missing

Recommended solvers

Analysis GPU (CUDA) CPU
Linear (PythonSparse, static/transient/…) nvmath.direct_solver scipy.spsolve or scipy.umfpack
Eigen cupy.eigsh scipy.eigsh

These PythonSparse backends are often faster than native OpenSees sparse/direct/eigen solvers on medium-to-large models because they use optimized library implementations. Details: recommended solvers.

Example

from openseespy_solvers import hybrid
from openseespy_solvers.scipy import spsolve

solver = hybrid(spsolve(), rtol=1e-6, restart=50)
ops.system("PythonSparse", solver.to_openseespy())
ops.analyze(n)

For Newton or transient steps where the tangent changes slowly, hybrid factorizes once then reuses that factorization as a GMRES preconditioner until the system size changes or GMRES fails to converge.

Submodules

Module Functions
openseespy_solvers.scipy spsolve, umfpack, cg, gmres, eigsh, lobpcg
openseespy_solvers.scipy.precond jacobi, ilu, direct
openseespy_solvers.cupy spsolve, cg, gmres, eigsh, lobpcg (GPU)
openseespy_solvers.cupy.precond jacobi, ilu, direct
openseespy_solvers.nvmath direct_solver (GPU)
openseespy_solvers.hybrid hybrid(direct=...) — frozen factorization + GMRES

Factory signatures match scipy.sparse.linalg and cupyx.scipy.sparse.linalg; A and b are supplied by OpenSees at solve time.

See the tutorial and API reference for details.

GitHub

Repository: github.com/gaaraujo/openseespy-solvers. Report bugs and ask questions via issues; send contributions (pull requests) there as well.

License

BSD 3-Clause — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openseespy_solvers-0.1.0.tar.gz (33.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openseespy_solvers-0.1.0-py3-none-any.whl (41.1 kB view details)

Uploaded Python 3

File details

Details for the file openseespy_solvers-0.1.0.tar.gz.

File metadata

  • Download URL: openseespy_solvers-0.1.0.tar.gz
  • Upload date:
  • Size: 33.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.5

File hashes

Hashes for openseespy_solvers-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1a79e7555a3932adf09e554125f8be0cf11e02f477ace4c6d96b49b6a3436c11
MD5 c5c15c04e591ab1c70df53a4c119291b
BLAKE2b-256 38ad6be2ac64e21d064dd5e42389ca52fc253f26b04b1cb7b095d98cc02d3d60

See more details on using hashes here.

File details

Details for the file openseespy_solvers-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for openseespy_solvers-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c2a5582911f503fba92c4add51933f82ac3c5cc7784904a0e7545538e2464644
MD5 e5dc7a31dc6de4abbb730a5113bf6b87
BLAKE2b-256 e485fc73d7239e9db89d5b6d8e259ac501a1d9f3199d5fd032833a8cff41664b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page