Skip to main content

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.

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.4.0.tar.gz (161.8 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.4.0-cp312-abi3-win_amd64.whl (536.0 kB view details)

Uploaded CPython 3.12+Windows x86-64

mapdl_archive-0.4.0-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (313.4 kB view details)

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

mapdl_archive-0.4.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (354.2 kB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ x86-64

mapdl_archive-0.4.0-cp312-abi3-macosx_11_0_arm64.whl (291.4 kB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

mapdl_archive-0.4.0-cp312-abi3-macosx_10_14_x86_64.whl (298.5 kB view details)

Uploaded CPython 3.12+macOS 10.14+ x86-64

mapdl_archive-0.4.0-cp311-cp311-win_amd64.whl (537.0 kB view details)

Uploaded CPython 3.11Windows x86-64

mapdl_archive-0.4.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (321.1 kB view details)

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

mapdl_archive-0.4.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (360.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

mapdl_archive-0.4.0-cp311-cp311-macosx_11_0_arm64.whl (295.6 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

mapdl_archive-0.4.0-cp311-cp311-macosx_10_14_x86_64.whl (302.4 kB view details)

Uploaded CPython 3.11macOS 10.14+ x86-64

mapdl_archive-0.4.0-cp310-cp310-win_amd64.whl (536.3 kB view details)

Uploaded CPython 3.10Windows x86-64

mapdl_archive-0.4.0-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (321.9 kB view details)

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

mapdl_archive-0.4.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (361.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

mapdl_archive-0.4.0-cp310-cp310-macosx_11_0_arm64.whl (296.3 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

mapdl_archive-0.4.0-cp310-cp310-macosx_10_14_x86_64.whl (303.1 kB view details)

Uploaded CPython 3.10macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: mapdl_archive-0.4.0.tar.gz
  • Upload date:
  • Size: 161.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mapdl_archive-0.4.0.tar.gz
Algorithm Hash digest
SHA256 1e35041accb7aa85eb54dc0de0576917f6d2f8dbc4a2f985d0dde2cf6228ee46
MD5 83b362a2cae8479fa1e5d1753a91d12a
BLAKE2b-256 80c9ca64656bee06e52eed87b42ad0d41d1a4e55e81db8960d8ebc44c8425e52

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mapdl_archive-0.4.0-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c4d9e8b1774b30020e160e15b6e43fc61ce817024925c2040589847aace31231
MD5 8c336b9ce0e4fb05379c6998492b5e3e
BLAKE2b-256 1e54a1c7aeedbcf775ff735cb54f4f1b463a5129d14073118497537a7382b519

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mapdl_archive-0.4.0-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 91d67a00bce3fdbdaaf89cf080738934f6779b862c136217f2145cdcdebc135a
MD5 2b0bec529ed77d26c8b7617e530420d4
BLAKE2b-256 ae054602b11034edbbd081c9dc402cc5187ac642ac2f665eb26eac7c838b2956

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.4.0-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.4.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.4.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 3ca1518ff561bdbd6941a4f956abdce8ca90212437a3f54c2b16a27b658dfd73
MD5 feb13054e30246ae54f361803be304b1
BLAKE2b-256 653499f6a33bbf955a1bb489add8bfe22d8f2d3baf78aab4dba7e2d2b8111771

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.4.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_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.4.0-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.4.0-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 aa23bb2056b7dfe08d6940fb8d8091d9da3775c85dd5f72eeb09f92c7799200c
MD5 f95a6de857c8929ec37b1aa6990508a0
BLAKE2b-256 37dacaa77a4c208df02819370182ba41e0fa0b26a0ee2666c812e7dc6437c638

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mapdl_archive-0.4.0-cp312-abi3-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 be15887ce0bb3cf8e79de1327dc3ea847d36be960fbf14a57aa442f251c4959f
MD5 898cc0874becb674db97d59632619da5
BLAKE2b-256 015c4dad08afd401ac5a3ca4146e72bd8bb6006db8d96f599f602bbf66d6d30b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mapdl_archive-0.4.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7457b2de30b36928f8464fa0af5229613c63322024d7de8ea398b65c94536352
MD5 f0d6a459ed5cb788fc53c3eb8d64669b
BLAKE2b-256 7eb5f70aa751d3bca8ca1f4a196ee77f4cbcbd455fbdb622cffd68ad712f8590

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mapdl_archive-0.4.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5cbe7fe8cae95a71c3bf595a787848094ede248420c01edcff9b38ac80b91d96
MD5 673a5856588313235f11633f3bcb7c11
BLAKE2b-256 a55e7e7977d38df961879a69c25dc8d428ba3b29a85f436df6b5e244a536708f

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.4.0-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.4.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.4.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 f51dd35d1971d0cb25ac250c077b700e37ca1b22791ab59db67e11cfff015483
MD5 3e5af2e2d4f1283ead086d959f4cd595
BLAKE2b-256 b4f18f91a6a4c00e1d8e1fd6f35a15cfacbe083a5b5195b7dd8d8c86d1ca385b

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.4.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_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.4.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.4.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1bb9f0ff9932b571189c429cd361d94e4b2b8c22ed82fae4028d2bc856955cea
MD5 590a9150528b2f62aa26d87ec28d6128
BLAKE2b-256 648f4ffd6a6cd9cfb24c70d9a64d7d8e7914b4443915d4fa0ff6ca9dd974255f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mapdl_archive-0.4.0-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 3fee4ff7ae685d960b180a6e2d5e69a2936f60b730f8c2cf013670161ea88773
MD5 7279d5d7c0f991aec27e71f8a64064be
BLAKE2b-256 5f08b932ba445bc53cd0a3c27e725376e0a84e9db2cd91db227c717f22cbbdbb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mapdl_archive-0.4.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 f51c0449c5298100721e29599cf9b22eeaa56656cc602cef900097721c5ae592
MD5 3059445132a4392f3a03469ca82bdd4e
BLAKE2b-256 f9223bc7a1acfc0d0e0178a201e5df962b7511948c91a02e5122b616fbb3ec71

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mapdl_archive-0.4.0-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 1fe7c6fcfa2e5d38ae3d3204d4c40a60b4c73460054fc281a783728fe9a0bde6
MD5 786fc48ea42142cfc50f7ca236fb5fd4
BLAKE2b-256 64cfb9942f3e736b45da6b69ad50df047ec5fe3120be63bdecf71f49dedf2a7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.4.0-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.4.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.4.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 295e622c07c0d6e0211d97c169420e51796de882a717cb2397b7b7ce12e82860
MD5 988c951f82e35cfec77c3e48f127e5a9
BLAKE2b-256 3abb72540c52887b2845036ba40535f0cf62260e322653f90d1f752ea72cc542

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.4.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_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.4.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mapdl_archive-0.4.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 50dd3067a3a33e1225043ab4c377c388352061d2ba0009c5be389cb59975ea84
MD5 e44703bfacea49dc0af254b385375a7e
BLAKE2b-256 7df85eca6dbe807e60fcccc9ea22b45d5216641893faf6f4f95d70bb21956e64

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mapdl_archive-0.4.0-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 9a1243733e97cd2477fc223da210a5c30cb717b559bf60f9786fe4b55819fda5
MD5 802f2c735977b14e18be632d47852f6b
BLAKE2b-256 ab7a296948d5feb6006d1d0e14c65d5ef7a69853b4355bbc60ebbc0247a21238

See more details on using hashes here.

Provenance

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

Release history Release notifications | RSS feed

This release

0.4.0 This release

16 files

0.3.0

16 files

0.2.11

16 files

0.2.10

16 files

0.2.9

16 files

0.2.8

15 files

0.2.7

21 files

0.2.6

21 files

0.2.5

21 files

0.2.4

21 files

0.2.3

17 files

0.2.2

17 files

0.2.1

21 files

0.2.0

21 files

0.1.5

21 files

0.1.4

20 files

0.1.3

21 files

0.1.2

17 files

0.1.1

17 files

0.1.0

17 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page