Repository navigation
Add AnsysUSERMATTarget backend #3
Copy link
Copy link
Open
Description
Goal
Generate an ANSYS USERMAT user subroutine. ANSYS Mechanical's user-defined material framework — Fortran-callable, similar shape to Abaqus UMAT but with different component conventions and argument ordering.
USERMAT signature (simplified)
extern "C" void usermat_(
int *matId, int *elemId, int *kDomIntPt, int *kLayer, int *kSectPt,
int *ldstep, int *isubst, int *keycut,
int *nDirect, int *nShear, int *ncomp,
int *nStatev, int *nProp,
double *Time, double *dTime,
double *Temp, double *dTemp,
double *stress, // (ncomp) in/out
double *ustatev, // (nStatev) in/out
double *dsdePl, // (ncomp, ncomp) out: Jacobian
double *sedEl, double *sedPl, double *epseq,
double *Strain, // (ncomp) in
double *dStrain, // (ncomp) in
double *epsPl, // (ncomp) in/out
double *prop, // (nProp)
double *coords,
double *rotateM,
double *defGrad_t, double *defGrad,
double *tsstif, double *epsZZ,
double *var0, double *var1, double *var2, double *var3, double *var4,
double *var5, double *var6, double *var7, double *var8);Convention differences from Abaqus
| Abaqus | ANSYS | |
|---|---|---|
| 3D component order | {11, 22, 33, 12, 13, 23} | {11, 22, 33, 12, 23, 13} |
| Shear strain | engineering (γ = 2ε) | engineering (γ = 2ε) |
| Stress sign | tension positive | tension positive |
| Tangent layout | DDSDDE row-major | dsdePl column-major (Fortran) |
The component-order swap means we need a different tmech Voigt adapter than abq_std. Either:
- Extend tmech with an
ansys_stdadapter, or - Use
abq_stdand add a 4×4 permutation matrix at the boundary.
Verify with tmech maintainer (you) which is preferable.
Tangent layout
ANSYS dsdePl is column-major (Fortran storage). The codegen needs to write the tangent in column-major order, or pre-transpose before writing.
What to emit
A .cpp file with:
- Embedded Layer-2 compute function.
extern \"C\"USERMAT entry point.- Boundary code with ANSYS-convention adapters and the column-major tangent write.
Acceptance criteria
targets/ansys_usermat.hwithAnsysUSERMATTarget.- Tests: signature match, ANSYS-order Voigt adapters used, column-major tangent write.
- Documentation in README.
Dependencies
- Add AbaqusUMATTarget backend #1 (AbaqusUMATTarget) — most patterns are shared.
- Possibly a tmech update for an
ansys_stdadapter (or use a runtime permutation).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
petlenz commentedon May 31, 2026
Tracked as Phase 6.3 of the NumSim compiler epic #28. Unblocks once Phase 3b (#35) lands; share the UMAT scaffolding from #2 once that exists.