Suppressing plasticity in Pymechanical? #1570
Unanswered
MarkGjeloshaj
asked this question in
Q&A
Replies: 1 comment 2 replies
-
|
I was was able to figure it out by recording myself suppress material data in mechanical: #region Details View Action #region Details View Action |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a material model I made with multilinear kinematic hardening and I need to suppress the plasticity but I don't want to strip the data from the file in case I need it later. Having way too much trouble with it here is a deep dive:
Product: Ansys Mechanical 2025 R2 (Build 25.2, UP20250519)
API: Embedded PyMechanical (via ansys-mechanical-core)
Platform: Windows 11, Intel Core Ultra 9 285K
Summary:
When programmatically suppressing a material model (e.g., Multilinear Kinematic Hardening) via the MaterialModel.Suppressed property, the suppression correctly removes the TB data from ds.dat and correctly shows the strikethrough in Engineering Data (when opening the mechdat). However, Mechanical still injects a bare tblist command into ds.dat during the /PREP7 phase, which fails because no TB table exists. In batch mode, this ERROR is fatal and the solve aborts without producing results.
Steps to Reproduce:
Import a material XML that includes Multilinear Kinematic Hardening (temperature-dependent stress-strain curves)
Access the material's MaterialModels collection and suppress the plasticity model:
materials = model.Materials
materials.Import(material_file_path)
mat = [m for m in materials.Children if m.Name == material_name][0]
for mm in mat.MaterialModels:
if "kinematic" in mm.Name.lower():
mm.Suppressed = True
Set up and solve a Static Structural analysis (tested with Cyclic Region symmetry)
Expected Behavior:
The solve should proceed without plasticity — linear elastic material behavior only. The suppression is correctly reflected in the Engineering Data UI (strikethrough text, checkbox in column D).
Actual Behavior:
MAPDL aborts immediately in /PREP7 with:
*** ERROR *** CP = 0.188 TIME= 20:55:36
No table is active. Use the TB command to activate a table first. The
TBLIST command is ignored.
The error is fatal in batch mode. No RST file is produced. The solve never reaches /SOLU.
Root Cause:
Mechanical injects a bare tblist command into ds.dat (observed at line ~40503 in our model) during the /PREP7 material/cyclic symmetry setup phase. This command is written regardless of whether any TB tables exist. When plasticity is suppressed, the TB data is correctly omitted from ds.dat, but the tblist validation command is still written. With no active TB table, tblist throws an ERROR.
Relevant ds.dat excerpt:
cglo,0.,0.,0.
tblist <--- this line causes the failure
/com,*********** Create Periodic/Cyclic Symmetry ***********
CYCOPT,USRROT,1
CYCOPT,STATUS
Workaround Attempted:
APDL command snippets with TBDELE — does not work because Mechanical regenerates material data from its internal model, ignoring APDL-level TB deletions
Moving suppression timing (before/after save, before/after solve) — same result
Beta Was this translation helpful? Give feedback.
All reactions