Skip to main content

Pythonic interface to ANSYS binary files

Project description

Python module to extract data from ANSYS binary files and to display them if vtk is installed. Currently supports (.rst) and (.full) files.

Installation

From PyPi directory

pip install pyansys

or

python setup.py install

License

ANSYScdb is licensed under the MIT license. The full statement is provided in the file named LICENSE.

Dependencies

Required: numpy, cython, ANSYScdb. Optional: vtk

Minimum requirements are numpy to extract results from a results file. To convert the raw data to a VTK unstructured grid, vtk 5.0 or greater must be installed with Python bindings.

Tests

Test installation with the following

from pyansys import Tests

# Load a hexahedral beam modal analysis result file
Tests.Reader.Load()

# Display first bending mode of that beam
Tests.Reader.Display()

# Load mass and stiffness matrices from the beam
Tests.Reader.LoadKM()

Example: Reading a Result File

This example reads in binary results from a modal analysis from ANSYS.

Example files can be found within the Tests folder in installation folder.

# Load the reader from pyansys
from pyansys import Reader

# Create result reader object
fobj = Reader.ResultReader('file.rst')

# Get mode frequencies
freqs = fobj.tvalues

# Get the node numbers in this result file
nnum = fobj.nnum

# Get the mode shape at mode 7 (ANSYS result 7)
disp = fobj.GetResult(6) # uses 0 based indexing

# Load CDB (necessary for display)
fobj.LoadCDB('mesh.cdb')

# Plot the displacement of Mode 41 in the x direction
fobj.PlotDisplacement(40, 'x')

Example: Reading a full file

This example reads in mass and stiffness matrices associated with Beam.cdb

Example files can be found within the Tests folder in installation folder.

# Load the reader from pyansys
from pyansys import Reader

# Create result reader object
fobj = Reader.FullReader('file.full')

# Read in full file
fobj.LoadFullKM()

# Data from the full file can now be accessed from the object
# Can be used construct a sparse matrix and solve it

# from scipy.sparse import csc_matrix, linalg
#ndim = fobj.nref.size
#k = csc_matrix((fobj.kdata, (fobj.krows, fobj.kcols)), shape=(ndim, ndim))
#m = csc_matrix((fobj.mdata, (fobj.mrows, fobj.mcols)), shape=(ndim, ndim))
# Solve
#w, v = linalg.eigsh(k, k=20, M=m, sigma=10000)
# System natural frequencies
#f = np.sqrt(real(w))/(2*np.pi)

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 Distributions

pyansys-0.11.zip (473.9 kB view details)

Uploaded Source

pyansys-0.11.tar.gz (462.5 kB view details)

Uploaded Source

Built Distributions

pyansys-0.11-cp35-cp35m-win_amd64.whl (421.9 kB view details)

Uploaded CPython 3.5m Windows x86-64

pyansys-0.11-cp27-cp27m-win_amd64.whl (429.8 kB view details)

Uploaded CPython 2.7m Windows x86-64

File details

Details for the file pyansys-0.11.zip.

File metadata

  • Download URL: pyansys-0.11.zip
  • Upload date:
  • Size: 473.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyansys-0.11.zip
Algorithm Hash digest
SHA256 795da32f1adea70e97e081382ef0d985ea8a04248da06185abb61b607d32394c
MD5 bd86ee1a305b07028bcf2bf55c7521c0
BLAKE2b-256 e946947aa7065f7f1efa4642b0c7912853b3e111832dc74c0224fea9684b18f8

See more details on using hashes here.

File details

Details for the file pyansys-0.11.tar.gz.

File metadata

  • Download URL: pyansys-0.11.tar.gz
  • Upload date:
  • Size: 462.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyansys-0.11.tar.gz
Algorithm Hash digest
SHA256 2499081d34f7a83a6ba882a95d59ef9c3a7c883a4b35f5a2f273ddfcf3ac7362
MD5 695f3fdf57752d6991351c1020ce13f1
BLAKE2b-256 237a9040be3156e463a652d42415f3554946cf3909dd58dacc004cb616aff4b1

See more details on using hashes here.

File details

Details for the file pyansys-0.11-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for pyansys-0.11-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 d1c5228c4d75f3e35136f624e4d30e597b3946c19ad31333b9f5c3820b6e7496
MD5 dfd715b268e0c2ff10b486339dd536e9
BLAKE2b-256 37b245d4a3516e47065311d27f6b333b9d9e6a5dd41a23015434d3916714227b

See more details on using hashes here.

File details

Details for the file pyansys-0.11-cp27-cp27m-win_amd64.whl.

File metadata

File hashes

Hashes for pyansys-0.11-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 643db2c35466a066cdff31b7397b172baabc3d2d4fe5f453f662e25043a55300
MD5 b5d20d75475b92e6b14c54948999a7bc
BLAKE2b-256 92c5d0bce1c0a93d6defa97c5bd7d4bebc29a0b39c5d0b9c8839775159826f16

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page