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.9.tar.gz (156.0 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.9-cp312-abi3-win_amd64.whl (283.1 kB view details)

Uploaded CPython 3.12+Windows x86-64

mapdl_archive-0.2.9-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.9-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.9-cp312-abi3-macosx_11_0_arm64.whl (265.6 kB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

mapdl_archive-0.2.9-cp312-abi3-macosx_10_14_x86_64.whl (277.1 kB view details)

Uploaded CPython 3.12+macOS 10.14+ x86-64

mapdl_archive-0.2.9-cp311-cp311-win_amd64.whl (287.0 kB view details)

Uploaded CPython 3.11Windows x86-64

mapdl_archive-0.2.9-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (307.6 kB view details)

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

mapdl_archive-0.2.9-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (294.3 kB view details)

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

mapdl_archive-0.2.9-cp311-cp311-macosx_11_0_arm64.whl (269.5 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

mapdl_archive-0.2.9-cp311-cp311-macosx_10_14_x86_64.whl (280.5 kB view details)

Uploaded CPython 3.11macOS 10.14+ x86-64

mapdl_archive-0.2.9-cp310-cp310-win_amd64.whl (287.4 kB view details)

Uploaded CPython 3.10Windows x86-64

mapdl_archive-0.2.9-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.9-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.9-cp310-cp310-macosx_11_0_arm64.whl (269.9 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

mapdl_archive-0.2.9-cp310-cp310-macosx_10_14_x86_64.whl (280.9 kB view details)

Uploaded CPython 3.10macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: mapdl_archive-0.2.9.tar.gz
  • Upload date:
  • Size: 156.0 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.9.tar.gz
Algorithm Hash digest
SHA256 e5c99858c606ea1ace322cbabd6205b23593deade29780fd5989936cbaf6c69e
MD5 86e3db05e63b33fcb2aafa753407b08a
BLAKE2b-256 df932d9b8aeda14967f28c7dc645e268c2d1891eccf0d2c305a2f6da844b7e03

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.9.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.9-cp312-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.9-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 78930635e3c23822cac90f8eae3fc36ede31f09b5ff5a85888c5644a97b232dd
MD5 bbef16933232e8f15a762ff8bcfef26a
BLAKE2b-256 a31139b98189c4af55ee99bb2777de24cad0c028c24ffb656af8b5b0851ea351

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.9-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.9-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.9-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fb12233c31c72388c73a7453a3d7e77b5a995e55d2feb21e4ad4866dface6f30
MD5 434508cc14385e922d362aa096213248
BLAKE2b-256 14e9961295e2d1c98c0251da9e685db3276b2572560d676c350631a3ab9f12cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.9-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.9-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.9-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 836bb15d423b59f700793d11741e4f649bdeb7154873b5dbbaebb447c6b007d8
MD5 f5ac73bd4a73f7128ebe3a7c59aa2834
BLAKE2b-256 293f5a71eabe476764219b12242d4125d50d9fdf6cb43c59e0b0e3300971af84

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.9-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.9-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.9-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7f58369260296168149a64bbdc31e19b2d3e170dca9a26a4177b4981ecd81bb3
MD5 a4d61e625d7ee711a2e7427becb6f291
BLAKE2b-256 e0620de37bddb15f5bad473d23faca747f728246af772d35ebd74db65a27d71e

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.9-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.9-cp312-abi3-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.9-cp312-abi3-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 42bf9ccb9f72ca27de5901b9e86e75e2078a369e6a1d80a51c3275e04c6b460d
MD5 86af097a08e8ec250e60e0d64bac119a
BLAKE2b-256 661f3b7c985f7f4c598f7a1c91d7056be4a2fe0f41bd28a078f08c3041360855

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.9-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.9-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.9-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1eb87dc537ea9bb7a0e0fa1abce6dfc057500ec59ca2142fbab02404821747a6
MD5 44a2d49e2ea78d31ba871312289840a6
BLAKE2b-256 8bfc240ac009181ba3bfaad987be40061b26a824b76a5d53b5635bed81f1d520

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.9-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.9-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.9-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 740b07dd69725dae09d50a7afe36dac2a191d40b31fb7b14fd69203ee4431df4
MD5 33001f4e9d61c8bf1312a1199af2443a
BLAKE2b-256 3ba55b13c622b3e68727eab07688ee0e9af4bfc8f35f1726af032f92a9b6e7d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.9-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.9-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.9-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 6502e7a8be23a843321f0dcc7ffa3ef4c4952de6e29d66d5649350c76ceca8c0
MD5 002a980dd85c4f406e2bbad1889dd642
BLAKE2b-256 6416d0881df23791f30f69526fdef4c8d3355944f1e2c0af7d1d30145ffe7a58

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.9-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.9-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.9-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7f2ac0c4ce34d40ec95ace148ef413033dd854ebb689620ba778901e70e52caf
MD5 1b591400edbed66395c58af8246e4daa
BLAKE2b-256 48590604b94b565d85916991417806c307257bc6a1fa843d9835418f56bf6f03

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.9-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.9-cp311-cp311-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.9-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 f837a7d00dbe688203606ffc0ea986fbd78e4a98a171a57b2df1b830e0769a0d
MD5 b8c9385994089b9ace0de37239d115b7
BLAKE2b-256 a1b54929df86da6f7ccbdf6d90ad5b37c55524efddd1d67202a6e299a1d44c2a

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.9-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.9-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.9-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 9331975d7fc91c1b443004a60c5ea84cc5744946689253f34d0f4b92747fb497
MD5 c5aa25844ea2562a9a1c339e89d9463b
BLAKE2b-256 8d8d936b052735453a18719e5ab6d75cb07ec0c7873799734e2eb213ffdab8d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.9-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.9-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.9-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 847803adc6ed6aa253d2699d963fd231975c4043c7e2be30050da6f3babf760a
MD5 880c7288233d9977320ee5e9081ad77f
BLAKE2b-256 6015a91dc42bb7b8494a6240723e9af03b0f67fedbdaa3cd5ba3fac7acb71502

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.9-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.9-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.9-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 6a77ff92eda6452957e4d13a7d8d9efbaca2f465181a2ec4ff3d1c570f3cf839
MD5 462c25ce471bff0bc5e8bfd49da24233
BLAKE2b-256 0115c87e6043ee83db5d877879c94e9aaae281c41b20a899f52aa248ef750b56

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.9-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.9-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.9-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1320561314d8550c56352ff932b2ee9b63d98d213dc5a61ba8450fa50d3b799b
MD5 32aafdb7ba89a42fcd985a376b55fba9
BLAKE2b-256 a8a501b22b0565109150b876773833b8d250433643e3acd4e6b2e39c0bbff15a

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.9-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.9-cp310-cp310-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.2.9-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 5708146661d899a671bb58b70797211cd288ff9b18633d6d425e65cd02cdc93a
MD5 13a1b330bd281df3bb46f66a46291680
BLAKE2b-256 61b8efdfc1a7f266144506b84ed34e02780813ded7d01db2ef2723e056e7f833

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.2.9-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