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 Distribution

pyansys-0.13.tar.gz (465.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyansys-0.13-cp35-cp35m-win_amd64.whl (421.6 kB view details)

Uploaded CPython 3.5mWindows x86-64

pyansys-0.13-cp27-cp27m-win_amd64.whl (429.5 kB view details)

Uploaded CPython 2.7mWindows x86-64

File details

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

File metadata

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

File hashes

Hashes for pyansys-0.13.tar.gz
Algorithm Hash digest
SHA256 ad3441a309dd68299201da299a73fabee10477d29f8f39109bf83dca8c989ab3
MD5 6840fb58194851d4c473ac242d814322
BLAKE2b-256 ac64a51c542bfa0d3593871312d53310e664765058fb5612724e9a78832fe156

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyansys-0.13-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 49bbd441a7dc95104e9b2224fad5b6f4d5f68cf4c64cd36fb3d6790fc1fbfcad
MD5 69567e211280cb1c97fb11500f5cf59f
BLAKE2b-256 9975f90b12ebf1c8fa3cc38c42db63f645c5320918490cd9607f53116e10bbe1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyansys-0.13-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 e770b660d460b2c9a510691b67b43d649314d7dd576b48c4228a2db3c7a92511
MD5 0f9341d7a2647d12e6f6d2043a7201ba
BLAKE2b-256 bb06f52d1d45eaa62c695d0313087227eb69bf5a0385b74f214bbf39619d73ea

See more details on using hashes here.

Supported by

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