MAPDL interop#
femorph-solver is a general-purpose structural solver with a
secondary MAPDL compatibility layer. If your starting point is
a MAPDL workflow (a CDB deck, an RST result, an APDL-style
declaration sequence), this page is where to start. If you’re
building from scratch, use the native Model
primitives shown in the Quickstart — they’re the primary API
and will stay so.
The deep dive on format compatibility lives in MAPDL compatibility.
Load a CDB deck#
One call (from_cdb) reads MAPDL’s ASCII deck format and returns
a Model ready to assemble:
from femorph_solver.mapdl_api.cdb import from_cdb
model = from_cdb("rotor_sector.cdb")
result = model.modal_solve(n_modes=12)
The CDB’s ET table is translated on load — every element id
declared with ET, i, SOLID186 is registered against the HEX20
kernel automatically. /UNITS is detected and stamped onto
model.unit_system. mapdl-archive (MIT) handles the parse;
MAPDL itself is never invoked.
APDL-style declaration commands#
When porting a deck line-by-line, the MAPDL-compat verbs mirror the APDL command set one-for-one:
APDL |
Native equivalent |
Notes |
|---|---|---|
|
|
Accepts neutral ( |
|
|
One property at a time. Prefer
|
|
|
Real-constant arrays. |
|
|
Native shortcut: |
|
|
Native shortcut: |
A MAPDL-literal quickstart equivalent:
import femorph_solver as fs
model = fs.Model.from_grid(fs.examples.quarter_arc_sector())
# APDL-literal declaration
model.et(1, "SOLID185") # ET, 1, SOLID185
model.mp("EX", 1, 2.1e11) # MP, EX, 1, 2.1e11
model.mp("PRXY", 1, 0.30) # MP, PRXY, 1, 0.30
model.mp("DENS", 1, 7850.0) # MP, DENS, 1, 7850.0
# One D per pinned node — hence why the native `fix(where=...)`
# is preferable when not porting from an APDL macro.
for nn in (1, 2, 3, 4):
model.d(nn, "ALL", 0.0) # D, nn, ALL, 0
result = model.modal_solve(n_modes=10)
Both styles produce identical stamps on the Model (et / mp /
d / f are the same code path as the native primitives; the
native methods just compose them). Mixing is allowed; the test
test_native_api_equivalent_to_mapdl_verbs pins round-trip
equivalence.
Format status#
Format |
Read |
Write |
Notes |
|---|---|---|---|
CDB |
✅ |
❌ |
Via |
RST |
✅ |
🚧 |
Read via |
FULL |
✅ |
🚧 |
K / M matrix export; |
EMAT |
✅ |
🚧 |
Per-element K / M; |
MODE / SUB / DB |
❌ |
❌ |
Planned. |
Element compatibility#
Each registered element targets the same behaviour as its MAPDL counterpart under the default KEYOPT settings. See the Elements for bit-level parity tests and the per-element pages under Element library for the KEYOPT table.