Metadata-Version: 2.1
Name: abaqus-mtx-parser
Version: 1.1.4
Summary: A python package to parse *.mtx files generated by the keyword *SUBSTRUCTURE MATRIX OUTPUT in Abaqus.
Author-email: HUANG Lihao <huang-lihao@outlook.com>
Project-URL: Homepage, https://github.com/huang-lihao/abaqus-mtx-parser
Project-URL: Bug Tracker, https://github.com/huang-lihao/abaqus-mtx-parser/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy

# Parser for `*.mtx` files in `Abaqus`
[![GitHub release (with filter)](https://img.shields.io/github/v/release/huang-lihao/abaqus-mtx-parser?logo=github)
](https://github.com/huang-lihao/abaqus-mtx-parser)
[![Upload Python Package](https://github.com/huang-lihao/abaqus-mtx-parser/actions/workflows/python-publish.yml/badge.svg)](https://github.com/huang-lihao/abaqus-mtx-parser/actions/workflows/python-publish.yml)
[![PyPI - Version](https://img.shields.io/pypi/v/abaqus-mtx-parser?logo=pypi)](https://pypi.org/project/abaqus-mtx-parser/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/abaqus-mtx-parser?logo=PyPI)](https://pypi.org/project/abaqus-mtx-parser/)
[![GitHub License](https://img.shields.io/github/license/huang-lihao/abaqus-mtx-parser)](https://github.com/huang-lihao/abaqus-mtx-parser/blob/main/LICENSE)


A python package to parse `*.mtx` files generated by the keyword `*SUBSTRUCTURE MATRIX OUTPUT` in Abaqus.


Install
----------------------
Use PyPI to install [abaqus-mtx-parser](https://pypi.org/project/abaqus-mtx-parser/):
```sh
pip install abaqus-mtx-parser
```

Usage
----------------------
Run the following script to parse the mtx file `inner.mtx`.
```python
from importlib.resources import files

from abaqus_mtx_parser import parse_mtx

mtx = files(
    "abaqus_mtx_parser.mtx.unsymmetric"
).joinpath("inner.mtx") # Path to "inner.mtx"
result = parse_mtx(mtx)

print(
    result.nodes,       # node numbers: [2, 3, 4, 5, 6, 7]
    result.dof,         # node dofs: {2: [1, 2, 3, 4, 5, 6], 3: [1, 2, 3, 4, 5, 6], 4: [1, 2, 3, 4, 5, 6], 5: [1, 2, 3, 4, 5, 6], 6: [1, 2, 3, 4, 5, 6], 7: [1, 2, 3, 4, 5, 6]}
    result.stiffness,   # stiffness matrix
)
```
