Skip to main content

Pythonic interface to MAPDL archive files.

Project description

pypi GH-CI MIT

Read blocked Ansys MAPDL archive files written from MAPDL using CDWRITE.

This is effectively pymapdl-reader without the binary reader. It’s been isolated to allow greater flexibility in development.

Installation

Installation through pip:

pip install mapdl-archive

Examples

Load and Plot an MAPDL Archive File

ANSYS archive files containing solid elements (both legacy and modern), can be loaded using Archive and then converted to a VTK object.

from mapdl_archive import Archive, examples

# Sample *.cdb
filename = examples.hexarchivefile

# Read ansys archive file
archive = Archive(filename)

# Print raw data from cdb
for key in archive.raw:
   print("%s : %s" % (key, archive.raw[key]))

# Create an unstructured grid from the raw data and plot it
grid = archive.parse_vtk(force_linear=True)
grid.plot(color='w', show_edges=True)

# write this as a vtk xml file
grid.save('hex.vtu')

# or as a vtk binary
grid.save('hex.vtk')
Hexahedral beam

You can then load this vtk file using PyVista or VTK.

import pyvista as pv
grid = pv.UnstructuredGrid('hex.vtu')
grid.plot()

Reading ANSYS Archives

MAPDL archive *.cdb and *.dat files containing elements (both legacy and modern) can be loaded using Archive and then converted to a vtk object:

import mapdl_archive
from mapdl_archive import examples

# Read a sample archive file
archive = mapdl_archive.Archive(examples.hexarchivefile)

# Print various raw data from cdb
print(archive.nnum, archive.nodes)

# access a vtk unstructured grid from the raw data and plot it
grid = archive.grid
archive.plot(color='w', show_edges=True)

You can also optionally read in any stored parameters within the archive file by enabling the read_parameters parameter.

import mapdl_archive
archive = mapdl_archive.Archive('mesh.cdb', read_parameters=True)

# parameters are stored as a dictionary
archive.parameters

Writing MAPDL Archives

Unstructured grids generated using VTK can be converted to ANSYS APDL archive files and loaded into any version of ANSYS using mapdl_archive.save_as_archive in Python followed by CDREAD in MAPDL. The following example using the built-in archive file demonstrates this capability.

import pyvista as pv
from pyvista import examples
import mapdl_archive

# load in a vtk unstructured grid
grid = pv.UnstructuredGrid(examples.hexbeamfile)
script_filename = '/tmp/grid.cdb'
mapdl_archive.save_as_archive(script_filename, grid)

# Optionally read in archive in PyMAPDL and generate cell shape
# quality report
from ansys.mapdl.core import launch_mapdl
mapdl = launch_mapdl()
mapdl.cdread('db', script_filename)
mapdl.prep7()
mapdl.shpp('SUMM')

Resulting ANSYS quality report:

------------------------------------------------------------------------------
           <<<<<<          SHAPE TESTING SUMMARY           >>>>>>
           <<<<<<        FOR ALL SELECTED ELEMENTS         >>>>>>
------------------------------------------------------------------------------
                   --------------------------------------
                   |  Element count        40 SOLID185  |
                   --------------------------------------

 Test                Number tested  Warning count  Error count    Warn+Err %
 ----                -------------  -------------  -----------    ----------
 Aspect Ratio                 40              0             0         0.00 %
 Parallel Deviation           40              0             0         0.00 %
 Maximum Angle                40              0             0         0.00 %
 Jacobian Ratio               40              0             0         0.00 %
 Warping Factor               40              0             0         0.00 %

 Any                          40              0             0         0.00 %
------------------------------------------------------------------------------

Supported Elements

At the moment, only solid elements are supported by the save_as_archive function, to include:

  • vtk.VTK_TETRA

  • vtk.VTK_QUADRATIC_TETRA

  • vtk.VTK_PYRAMID

  • vtk.VTK_QUADRATIC_PYRAMID

  • vtk.VTK_WEDGE

  • vtk.VTK_QUADRATIC_WEDGE

  • vtk.VTK_HEXAHEDRON

  • vtk.VTK_QUADRATIC_HEXAHEDRON

Linear element types will be written as SOLID185, quadratic elements will be written as SOLID186, except for quadratic tetrahedrals, which will be written as SOLID187.

License and Acknowledgments

The mapdl-archive library is licensed under the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mapdl_archive-0.2.10.tar.gz (155.9 kB view details)

Uploaded Source

Built Distributions

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

mapdl_archive-0.2.10-cp312-abi3-win_amd64.whl (469.8 kB view details)

Uploaded CPython 3.12+Windows x86-64

mapdl_archive-0.2.10-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (299.5 kB view details)

Uploaded CPython 3.12+manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

mapdl_archive-0.2.10-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (286.9 kB view details)

Uploaded CPython 3.12+manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

mapdl_archive-0.2.10-cp312-abi3-macosx_11_0_arm64.whl (265.7 kB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

mapdl_archive-0.2.10-cp312-abi3-macosx_10_14_x86_64.whl (277.2 kB view details)

Uploaded CPython 3.12+macOS 10.14+ x86-64

mapdl_archive-0.2.10-cp311-cp311-win_amd64.whl (473.7 kB view details)

Uploaded CPython 3.11Windows x86-64

mapdl_archive-0.2.10-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (307.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

mapdl_archive-0.2.10-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (294.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

mapdl_archive-0.2.10-cp311-cp311-macosx_11_0_arm64.whl (269.6 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

mapdl_archive-0.2.10-cp311-cp311-macosx_10_14_x86_64.whl (280.6 kB view details)

Uploaded CPython 3.11macOS 10.14+ x86-64

mapdl_archive-0.2.10-cp310-cp310-win_amd64.whl (474.1 kB view details)

Uploaded CPython 3.10Windows x86-64

mapdl_archive-0.2.10-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (308.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

mapdl_archive-0.2.10-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (294.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

mapdl_archive-0.2.10-cp310-cp310-macosx_11_0_arm64.whl (270.0 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

mapdl_archive-0.2.10-cp310-cp310-macosx_10_14_x86_64.whl (281.0 kB view details)

Uploaded CPython 3.10macOS 10.14+ x86-64

File details

Details for the file mapdl_archive-0.2.10.tar.gz.

File metadata

  • Download URL: mapdl_archive-0.2.10.tar.gz
  • Upload date:
  • Size: 155.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mapdl_archive-0.2.10.tar.gz
Algorithm Hash digest
SHA256 09f1c1ba595bdc56f6ee4ffbc2120d5f66d41af74013a9b5842ee62001e96ea2
MD5 30ee22c1770ea14412ce51289a5a8645
BLAKE2b-256 2ebb8d503b601037e7941efddf51675cefdb1d3298c7fdb5095492417c646629

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.10.tar.gz:

Publisher: testing-and-deployment.yml on akaszynski/mapdl-archive

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mapdl_archive-0.2.10-cp312-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.10-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 6f1a94d0b8a93d78cf097b5ba9d752d900032e0a11f58b68d96cb053ac8bdac8
MD5 0b4fb53ca7b70d70eef422204e6dae95
BLAKE2b-256 d50223f1515990ee60de7e3117e1e45fecf564bc7fae20b9967d2f1edd990bbd

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.10-cp312-abi3-win_amd64.whl:

Publisher: testing-and-deployment.yml on akaszynski/mapdl-archive

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mapdl_archive-0.2.10-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.10-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ea45f33745f98cd69ebd1cd3abd8284f84df27b5a1546ba8cbf5cd0f587496fa
MD5 2670ca680a238aa9793eb18fee0f20c0
BLAKE2b-256 de74bde61c9c6ed21d8b25e021933949f9f22073b205ce3b5afca156a18ac243

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.10-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: testing-and-deployment.yml on akaszynski/mapdl-archive

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mapdl_archive-0.2.10-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.10-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 1156ab5c4733e792d029a037f9437f370680d5a599ce58b36bbcc59634c1677f
MD5 8d3d296aba57c6f280090d86063f7001
BLAKE2b-256 d21c086cf84fff14f8d3592b2f9f6707e56395a5f118767e3635a1573879406f

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.10-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl:

Publisher: testing-and-deployment.yml on akaszynski/mapdl-archive

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mapdl_archive-0.2.10-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.10-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 950282e5c24f458c99eee8e9ca149d29f87a38d23aec2c792a697750a8d8c4a8
MD5 895eca9420c1d5e9bc3bcc1cd30688fd
BLAKE2b-256 bea35ca898b08172f0ca44144ee61e24a3cfafeb6c7799aa3a483f4ed7679ee5

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.10-cp312-abi3-macosx_11_0_arm64.whl:

Publisher: testing-and-deployment.yml on akaszynski/mapdl-archive

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mapdl_archive-0.2.10-cp312-abi3-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.10-cp312-abi3-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 24adb56795b105134021ff97263da2b547172eaf296672941d2b4b4925c53875
MD5 f5fbe78f2cac36843ae032360c78cd5b
BLAKE2b-256 34fd887737ade57e48e1be695de4cafe8d59f7af6b3fca6dfcc83b563ce97c37

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.10-cp312-abi3-macosx_10_14_x86_64.whl:

Publisher: testing-and-deployment.yml on akaszynski/mapdl-archive

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mapdl_archive-0.2.10-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.10-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9b9e247faebf42d7cae4ae310804f3f2f2dc174c09bb673edd9b078c209f7379
MD5 f7b310d2a814a08ce1d086a57e2b69f8
BLAKE2b-256 8a33b54eb54b4eabe74930635a89254f7ce1e12ed5b4f86f21db206262059474

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.10-cp311-cp311-win_amd64.whl:

Publisher: testing-and-deployment.yml on akaszynski/mapdl-archive

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mapdl_archive-0.2.10-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.10-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e18ca26c06dcf1a34d1652cce2ad816d7170a5bbfa1340ec0a284407b6eac207
MD5 a47374bfb5c0f1d38aed1e0be47559ff
BLAKE2b-256 a3c176179d720a53aef53903c96e9fd3ba61ea1e0e094232d27cac8848b6c6df

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.10-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: testing-and-deployment.yml on akaszynski/mapdl-archive

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mapdl_archive-0.2.10-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.10-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 44b500e0c9170b0425937e5d32164951222beea660b40bc05f63267db1a1313f
MD5 89bf6cfec795b80c0ac1ce003b6a0f67
BLAKE2b-256 7026c233fe3a308522e6cc1cee775ce9e8adea5129511461b3c323ce173a39a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.10-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl:

Publisher: testing-and-deployment.yml on akaszynski/mapdl-archive

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mapdl_archive-0.2.10-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.10-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1e113f1322334272104cc52ea9e6e7c227cc1b494c7bfae3b5b5a49e6fabc688
MD5 64a9492a21c78a5d10a1a3fb8f766b5b
BLAKE2b-256 0ac77c632743a23a98accfd26a5002d00354a40fca74ead739fa7ef113ad7c59

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.10-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: testing-and-deployment.yml on akaszynski/mapdl-archive

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mapdl_archive-0.2.10-cp311-cp311-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.10-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 ba4cfb79927e01397f33aeffb28d6887c85cc8cd8027d98c74dd743430d84405
MD5 abfb44e8de82addb8f56c21c6f632d6e
BLAKE2b-256 176cc2d96b8934ea2527012bb1d5eb00960fca261750c4fd60be16b58ef3fbba

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.10-cp311-cp311-macosx_10_14_x86_64.whl:

Publisher: testing-and-deployment.yml on akaszynski/mapdl-archive

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mapdl_archive-0.2.10-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.10-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 db313c3384b19f6b2fdedbde86969bb815caeca2362e239412830b5d39d33d35
MD5 c486cd3aeb53dbc80c0660f024e4b283
BLAKE2b-256 e57069e02d74b2848a4b50e94e431b12ef2ee67d2ba51cc84b4c98f52547ebfa

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.10-cp310-cp310-win_amd64.whl:

Publisher: testing-and-deployment.yml on akaszynski/mapdl-archive

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mapdl_archive-0.2.10-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.10-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c328e762047026ebd66bc52d680abd2d5acf69d96108bd8a5156dcb0e9ea7e51
MD5 ad6b56d489a65e310d438d5bba0d90ca
BLAKE2b-256 5b3a2022199435c77a81190e9df8331bf811b259b7af78fbf54d34905314faca

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.10-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: testing-and-deployment.yml on akaszynski/mapdl-archive

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mapdl_archive-0.2.10-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.10-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 21e96b4e10a266af21fa90b9a930b42c2f3ad88d64b62848a4ca471d8ba14db5
MD5 e6de3597b8fdc7266e5777141b16d675
BLAKE2b-256 ccb5fc89f96e7be7108628c0db99968cecb85aede1cbb89d782ffd0a863f57d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.10-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl:

Publisher: testing-and-deployment.yml on akaszynski/mapdl-archive

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mapdl_archive-0.2.10-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.10-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6bb9c808e982d5d02cbced2c909007d44ff176e40aa6c7133b3b250af281a8ba
MD5 df34da86722f93521e60117c06a925e6
BLAKE2b-256 e0f8fe0aa5f8d8ada84ca509fb608b1c18677bfed5ca47ccf1275eae2ae39d38

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.10-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: testing-and-deployment.yml on akaszynski/mapdl-archive

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mapdl_archive-0.2.10-cp310-cp310-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.10-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 0068d93ff5d471e7e7f56172e1395df3edca6253151adc8409f8da946ef10140
MD5 000165bcc7dd6427b84f77d58265d1b8
BLAKE2b-256 f31a4fe4fd3615bd747b3e1a4d76fc71c639f99017960131f850599bedc3fefe

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.10-cp310-cp310-macosx_10_14_x86_64.whl:

Publisher: testing-and-deployment.yml on akaszynski/mapdl-archive

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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