MUMPS for Python
Project description
MUMPSpy
A python wrapper for the sparse direct solver.
The wrapper allows:
- real and complex factorization of symmetric or non-symmetric matrices
- Schur complement calculation
Requirements
Ubuntu/Debian users can use the following command to install the required packages:
apt-get install python-mpi4py libmumps-dev
Installation
pip install mumpspy
Usage
import mumpspy
import numpy as np
import scipy.sparse as sp
row = np.array([0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3])
col = np.array([0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 0, 1])
val = np.array([1, 2, 2, 1, 1, 3, -1, 2, 1, 1, 3, 1], dtype='d')
b = np.array([15, 12, 3, 5], dtype='d')
A = sp.coo_matrix((val, (row, col)), shape=(4, 4))
solver = mumpspy.MumpsSolver() # initialize solver, real-valued system
solver.set_mtx(A) # set sparse matrix
x = solver.solve(b) # solve system for a given right-hand side
print(x)
Compatibility
Tested for the following MUMPS library versions:
- 4.10.0
- 5.0.2
- 5.1.2
- 5.2.1
- 5.4.1
- 5.6.1
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mumpspy-1.3.3.tar.gz
(8.5 kB
view details)
Built Distribution
File details
Details for the file mumpspy-1.3.3.tar.gz
.
File metadata
- Download URL: mumpspy-1.3.3.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8ea6b6f838d4e7edec7da0c3b799a60025035b3b4829dad317876c1d1f61351 |
|
MD5 | 97692c58b2df97e8335dd9fda03eb9e1 |
|
BLAKE2b-256 | 150a2b1dcbf1e92e5532e659c3d138d4026aab5ec844d26581c9b5b1bd72484e |
File details
Details for the file mumpspy-1.3.3-py3-none-any.whl
.
File metadata
- Download URL: mumpspy-1.3.3-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7094e42d9b6a5f03e2f374c26bf73ee69beb9793aca2fd3177df737bbeacb00d |
|
MD5 | 3686b51aec4a21b28566af158697f24e |
|
BLAKE2b-256 | dc828af9353f9a8a22b8509782da594d8900a9ff548bb2f1dda4f36da292dcc4 |