Skip to main content

mesh2cdb

Write MAPDL .cdb archives from any mesh meshio reads.

meshio reads about forty mesh formats and writes thirty. .cdb is not one of them, so a mesh built in gmsh, Abaqus or Nastran has no path into MAPDL. That is the gap this fills.

Installation

pip install mesh2cdb

Usage

mesh2cdb part.msh -o part.cdb
mesh2cdb part.inp                 # .bdf, .vtu, .vtk, ...
part.msh -> part.cdb
  1364 nodes, 650 tetra10
  node component FIXED: 205
  elem component BODY: 650

From Python:

import meshio
from mesh2cdb import from_meshio, write

write(from_meshio(meshio.read("part.msh")), "part.cdb")

Then in MAPDL:

from ansys.mapdl.core import launch_mapdl

mapdl = launch_mapdl()
mapdl.prep7()
mapdl.cdread("DB", "part.cdb")

Elements

cell MAPDL
tetra SOLID285
tetra10 SOLID187
hexahedron, wedge, pyramid SOLID185
hexahedron20, wedge15, pyramid13 SOLID186

Wedges and pyramids are written as degenerate SOLID185/186 with repeated nodes. Unsupported cell types raise rather than being silently dropped.

Named regions

gmsh physical groups and Abaqus *NSET/*ELSET become MAPDL components:

gmsh.model.addPhysicalGroup(2, [face], name="fixed")   # in the mesher
mapdl.cmsel("S", "FIXED")                              # in MAPDL
mapdl.d("ALL", "ALL", 0)

Solid groups become element components; surface groups become node components. Names are uppercased, non-alphanumeric characters become underscores, and the limit is 32 characters. Two names that collide after that are refused rather than merged.

The mesh converts from every format meshio reads. Names do not:

source mesh named regions
.msh saved by gmsh yes yes
.inp (Abaqus) yes yes
.msh written by meshio yes no
.vtu, .vtk, .bdf yes no

Not supported

Materials, sections, boundary conditions, loads and load steps. .cdb carries all of them; this writes nodes, elements, element types and components only.

Shells and beams.

CAD geometry. MAPDL cannot import STEP; mesh it in gmsh and convert the mesh.

Tests

pip install mesh2cdb[test]

python tests/verify_meshio.py         # reader agreement
python tests/verify_formats.py        # what survives each format
python tests/verify_all_elements.py   # patch test per element type, launches MAPDL
python tests/verify_cmblock.py        # named regions reach MAPDL, launches MAPDL

Each asserts and exits non-zero. tools/ holds interactive helpers for regenerating the node-ordering tables and inspecting a .cdb; they open windows, so they are run by hand.

gmsh and ansys-mapdl-core are test dependencies only. ansys-mapdl-core>=0.73.2 is a hard floor: earlier versions fail to launch MAPDL 2026 R1 with MapdlDidNotStart: No err file generated.

Licence

MIT. Not affiliated with Ansys, Inc. Using the output requires a legal Ansys licence.

Release files for mesh2cdb 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mesh2cdb 0.1.0
File Size Uploaded
mesh2cdb-0.1.0.tar.gz 11.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mesh2cdb 0.1.0
File Interpreter ABI Platform
mesh2cdb-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.7 kB

Release files / mesh2cdb-0.1.0.tar.gz

Download URL mesh2cdb-0.1.0.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e2c30eeff7387e7ccd67fd539190a189dd687788145af1d521d4912ce1ea7455
BLAKE2b-256 checksum
How to use checksums
0aeac1efaad92290a1dccc73d16a01e01be83dd2af701e7030d2046c56d97cfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 10, 2026.

Transparency log

Release files / mesh2cdb-0.1.0-py3-none-any.whl

Download URL mesh2cdb-0.1.0-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0024f56a45222086ebda3c1c50d5ae394e901c7c6977ec676e8e9c23906be49c
BLAKE2b-256 checksum
How to use checksums
30f90218cd243f54cb35ec249b98e6cebd1def3f8e6cb153c2f9bf273877ec3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release 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