https://github.com/idling-mind/pansys
Work with ANSYS interactively from python
https://github.com/idling-mind/pansys
ansys ansys-apdl mechanical-engineering python python3
Last synced: about 2 months ago
JSON representation
Work with ANSYS interactively from python
- Host: GitHub
- URL: https://github.com/idling-mind/pansys
- Owner: idling-mind
- License: mit
- Created: 2018-07-11T08:55:53.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-02-22T09:03:36.000Z (over 7 years ago)
- Last Synced: 2025-09-11T09:56:29.896Z (9 months ago)
- Topics: ansys, ansys-apdl, mechanical-engineering, python, python3
- Language: Python
- Size: 511 KB
- Stars: 6
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pansys
[](https://pansys.readthedocs.io/en/latest/?badge=latest)
Work interactively with ANSYS mechanical APDL and python.
The pansys module helps you interact with ansys through python. Starting a
panys session is as easy as setting a variable.
```python
from pansys import Ansys
ans = Ansys()
```
Now you're ready to send commands to your newly created ansys session.
```python
ans.send("/prep7")
ans.send("""n,,1
n,,2""")
```
As you must have guessed, ``ans.send`` command will let you send commands
from python to ansys in string format.
You can get data out of Ansys as well.
```python
nmax = ans.get("node","","num","max")
ncount = ans.get("node","","count","")
```
Using ``get_list()`` function, you can get any ansys list item as well.
```python
nodes = ans.get_list("nlist")
```
You can also start an ansys session in a remote machine. You will have to set up your ssh keys for this to work.
```python
ans = Ansys(host="remotesystem")
```
Look into the documentation to get to know the API better.
## Installation
As of now, pansys is supported only on Linux systems. You will also need ANSYS installation on your computer
(or on the remote system, if you are using the ``host`` option when you're starting pansys).
```bash
pip install pansys
```
The module assumes that you have ANSYS already installed in your machine. Also, the default command that the module is using
is ``ansys150``. You can override it with the ``start_command`` keyword argument.
```python
a = Ansys(startcommand='my_ansys_command')
```
If you want to change the default start command from ``ansys150``, you can set an environment variable ``PANSYS_STARTCOMMAND``.
The value of this environment variable will be used as the start command. This value will be overridden if you explicitly call
``Ansys`` session with a ``startcommand``.
## Documentation
You can find the documentation at [readthedocs](https://pansys.readthedocs.io/en/latest/index.html)