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.3.0.tar.gz (158.3 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.3.0-cp312-abi3-win_amd64.whl (480.9 kB view details)

Uploaded CPython 3.12+Windows x86-64

mapdl_archive-0.3.0-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (300.3 kB view details)

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

mapdl_archive-0.3.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (339.1 kB view details)

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

mapdl_archive-0.3.0-cp312-abi3-macosx_11_0_arm64.whl (279.4 kB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

mapdl_archive-0.3.0-cp312-abi3-macosx_10_14_x86_64.whl (287.7 kB view details)

Uploaded CPython 3.12+macOS 10.14+ x86-64

mapdl_archive-0.3.0-cp311-cp311-win_amd64.whl (484.6 kB view details)

Uploaded CPython 3.11Windows x86-64

mapdl_archive-0.3.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (308.2 kB view details)

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

mapdl_archive-0.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (347.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

mapdl_archive-0.3.0-cp311-cp311-macosx_11_0_arm64.whl (283.8 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

mapdl_archive-0.3.0-cp311-cp311-macosx_10_14_x86_64.whl (291.5 kB view details)

Uploaded CPython 3.11macOS 10.14+ x86-64

mapdl_archive-0.3.0-cp310-cp310-win_amd64.whl (485.0 kB view details)

Uploaded CPython 3.10Windows x86-64

mapdl_archive-0.3.0-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (308.9 kB view details)

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

mapdl_archive-0.3.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (348.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

mapdl_archive-0.3.0-cp310-cp310-macosx_11_0_arm64.whl (284.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

mapdl_archive-0.3.0-cp310-cp310-macosx_10_14_x86_64.whl (292.2 kB view details)

Uploaded CPython 3.10macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: mapdl_archive-0.3.0.tar.gz
  • Upload date:
  • Size: 158.3 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.3.0.tar.gz
Algorithm Hash digest
SHA256 bc6324263a8d4b68400066f0909803616dc355f0d1bf810e76bddba61d0242e2
MD5 16b954fdd67d771b76d15f498d2817d2
BLAKE2b-256 f1086ecc0d042f2a06add0d55f8ac1fd47dbca27ad64ad22fb56fd3c8ba358e8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mapdl_archive-0.3.0-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 58e2b4ff7bdc8c0e0044997a8ccb0416e4ee2dfc98af532579cd4ac7fffb9080
MD5 a5fdcfb4222632fae6b39f7430cff5fa
BLAKE2b-256 f822c8a05a8ae0b1c5e78b24198ca1dbe34f31c80bcac68e4741d0379989fb84

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mapdl_archive-0.3.0-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 a85166bcaa5bab60aaa9162eada047b2206642a565c2ab079278a2a263c22daf
MD5 651936888f7c934a49aa64bd2efac922
BLAKE2b-256 b198d4f4b7f019625f6599940a03b14d72c0b4e8924ece8c3cf3d8829280c468

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mapdl_archive-0.3.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 9bbe51fab41018c80d214ef5aeaa28b99505a343c587f81f1fd9461ab8f596fa
MD5 e8da5deae2be2ce899821a07244a5a30
BLAKE2b-256 51158230b9d278e3c3a9154f58807d7b13f80b5b868c8a99d0f78472c60ff060

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mapdl_archive-0.3.0-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8df432f7761dafc8db4d757f5ab4232e201a71adf8d56cf353a60476da40d84a
MD5 3a55806f160d1d4fcdb5db5e5e764e9e
BLAKE2b-256 08ef86b1d533d1d162e7e7f801e74935f7460871691a1f1e43a6357ac5537266

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mapdl_archive-0.3.0-cp312-abi3-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 b0a33245ad717414db21d0b184c6fc9b0950d15454d88f3e724224dd287beb4a
MD5 eb34524a812aab11e2a72bfd6ab85c6b
BLAKE2b-256 68298a5c1d5ab61087f8f4d39b1ff8e8e703d164d6b8e98b8d98d4b5fceb9b72

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mapdl_archive-0.3.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9376b57c44ca06b7a12a40a80ff78a64b81da33e24adb3566d2b786be26df473
MD5 1f022fa64045821d7b563b7c5b265af6
BLAKE2b-256 0bd4710232c01a6a54d33ccd03c874d922b19b3e16254ae888454135785c68fd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mapdl_archive-0.3.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 92c6eec71b45fcba85f7e2eea7d4084e05e350cc382a39a204889dded3029548
MD5 a4131c150b08ec5e23f972e2017eeaf9
BLAKE2b-256 6d8e7989c9fbeb2a02a178f6397f619def95d848d0f071f619b26c9f2fab93ff

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mapdl_archive-0.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 9ea649b8f779a51f3d0e643d362e0826aa7a6ec64354c76f6f4d000080966be7
MD5 72a3f559f12f3356d9f0fb3039c63bdc
BLAKE2b-256 2b2e00754a11277da65316fb4411596a98da91ad8a48d2fc18e91bc705243d87

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mapdl_archive-0.3.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3db831945271e82435b7fd66080315ee1adb06a6a8cdc7f9b8b8f2bd46980a58
MD5 75a4ee843e6edecbc42f505254a4468b
BLAKE2b-256 7c2a9b12b3c53564f9bc922c8a14067f185fe0099069f7ac7e9957f2dab20db1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mapdl_archive-0.3.0-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 8de61267b1e655bfb1c6fa35df25c487f9ce73f83df263309cce7cc3583a3d30
MD5 a7108965b86613b74872afdfc7d896d0
BLAKE2b-256 4f5d486a9e3c627977c097a23c6a3fb3baa79c625cd7743ee3199ee3e601619c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mapdl_archive-0.3.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 dfe17047347ffa80169627f9979125a39d1491ad1fde218f2ca2ec9f15cb3e34
MD5 eee5daa08a6088dd1972f793a74437f4
BLAKE2b-256 282ae6e2699fa58488131b98b3c6bcf904e6cd32c143b95fa6925fd12974e99f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mapdl_archive-0.3.0-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b05b07ab382a7c1703df81272128de586b6d8e893e16489a38921275eb7146a5
MD5 bd73e9f070578703987afe9f05021824
BLAKE2b-256 74cfe9c4dd8c0044b6bfc841fd8b55aec335e6c3dfce873d5499fd1a86794200

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mapdl_archive-0.3.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 f88ae87f0fb57e9238a5e9411597486e3ab0d82de33ff2e1e8eb23e35242ff8b
MD5 299285353b7913719f3202c3e1824e5e
BLAKE2b-256 74376e3b02c8914e901d8dc125d188ce547c3402e8239268c37f665da5873737

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mapdl_archive-0.3.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f7e5dd05b64dbee677232818a46c04db1779c4c6914a56a4d2c81c7a6f8c9c17
MD5 bb675570c8038266eccbf926b5f29f18
BLAKE2b-256 01bbc9c0fc02bba23c723893583eb4aee385044d907f85ae8a59095363272604

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mapdl_archive-0.3.0-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 ea38c3dcfcdabbde88aadc855a80c08c76b91b6466ec08223bcf9db37457f450
MD5 0df89e25a6c440df57d7ab5f2d302d11
BLAKE2b-256 3421442d469e790fbdb1e726b8b23ed323acc8a3c1857062f364eb6ff745b501

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapdl_archive-0.3.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.3.0 This release

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

Supported by

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