GithubHelp home page GithubHelp logo

idling-mind / pansys Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 3.0 523 KB

Work with ANSYS interactively from python

License: MIT License

Python 100.00%
python python3 ansys ansys-apdl mechanical-engineering

pansys's Introduction

pansys

Documentation Status

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.

    from pansys import Ansys
    ans = Ansys()

Now you're ready to send commands to your newly created ansys session.

    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.

    nmax = ans.get("node","","num","max")
    ncount = ans.get("node","","count","")

Using get_list() function, you can get any ansys list item as well.

    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.

    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).

    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.

    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

pansys's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pansys's Issues

Windows support

In windows, ANSYS Mechanical APDL command window opens up as a separate window and hence pexpect is not able to send keys to that window natively. It is however possible to read the output of ANSYS.

One thought of solving this is using win32api; Finding out the window id of the newly opened MAPDL window and then sending keystrokes to it. But it wont be a robust solution.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.