Skip to main content

Introducing PyAnsys

| 04.01.2022

Welcome to our new series, Script Tip Friday!

We'd like to start this series by having our Senior Principal R&D Engineer, Pierre Thieffry, introduce PyAnsys and tell you about his expertise on the subject. Enjoy!

"Many companies have developed internal tools to support the design of their products - from simple Excel spreadsheets to more complicated fatigue or vibration analysis. To achieve high accuracy, it is often required to use finite element simulations to feed these tools. And a typical process will require to run the FE analysis, then run the internal tool. What if you could simply run your internal tool and that tool would run the FE simulation in one step? This is an obvious benefit the PyAnsys tools will bring to you.

The PyAnsys project is a collection of Python packages to enable the usage of Ansys products through Python. Two packages will let you setup and run structures or electronics simulations: PyMAPDL and PyAEDT.

PyAnsys
What is PyAnsys?

Let's talk about my own area of expertise: PyMAPDL gives you access to Ansys's flagship structural simulation products from a Python interface, allowing to combine the widely used APDL language with the Python libraries you are likely already using, say for example Numpy or matplotlib. 

The project also gives you access to pyDPF, a very powerful tool that provides numerical simulation engineers with a toolbox for accessing and transforming simulation data. DPF stands for Data Processing Framework. pyDPF will let you deal with large sets of data and run them through operators - pretty much like a system simulation would. Data goes to an operator and the output of this operator can be linked to the next one for more complex operations. Using pyDPF, you can create your own complex results from standard analysis quantities such as displacements, stresses or strains. Not only does it offer typical mathematical operators such as matrix and vector operations, trigonometry or Fourier transformations, but it will also give you access to finite element information such as element volumes, elements centroids, nodes connectivity... And if that was not enough for your needs, you could also create your own operators. 

PyAnsys Ecosystem
PyAnsys Ecosystem

In working with users from different industries, I have seen a large variety of applications for pyAnsys: automation of entire processes for design variations or creating large datasets for machine learning, creation of dedicated post-processing procedures, creation of vertical applications for example in the healthcare industry... 

And if you combine pyAnsys packages with the other scripting capabilities available in our products such as Ansys Mechanical, the limit in potential applications is really your imagination, not so much the products."