Skip to content

Move augmented-Lagrangian pressure update into USERMAT to fix compile error#1

Open
DexterQiu wants to merge 2 commits intomainfrom
codex/generate-fortran-code-for-neo-hookean-model
Open

Move augmented-Lagrangian pressure update into USERMAT to fix compile error#1
DexterQiu wants to merge 2 commits intomainfrom
codex/generate-fortran-code-for-neo-hookean-model

Conversation

@DexterQiu
Copy link
Copy Markdown
Owner

Motivation

  • Fix a compilation/scope error caused by the augmented‑Lagrangian pressure update being placed outside the USERMAT subroutine, which produced an undeclared STATEV reference and an end‑of‑file syntax error.

Description

  • Relocated the augmented‑Lagrangian pressure update (STATEV(1) = P + KAPPA * (J - 1.0D0)) into the USERMAT subroutine immediately before RETURN so the pressure-like multiplier is updated in the correct scope.

Testing

  • No automated tests were executed for this change.

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8113b91fac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +90 to +96
! Fill STRESS (Voigt) with 2nd PK stress (Total Lagrangian)
STRESS(1) = S2PK(1,1)
STRESS(2) = S2PK(2,2)
STRESS(3) = S2PK(3,3)
STRESS(4) = S2PK(1,2)
STRESS(5) = S2PK(2,3)
STRESS(6) = S2PK(1,3)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Guard Voigt writes for non-3D NTENS

This USERMAT assumes a 3D Voigt layout and writes STRESS(5) and STRESS(6) unconditionally. In ANSYS, 2D elements (plane strain/stress) use NTENS=4, so this will index past the end of STRESS (and later DDSDDE in the 1..6 loop), which can corrupt memory or crash the solver when the same material is used with 2D elements. If this routine is intended to be reusable, it should either restrict itself to 3D-only usage or branch on NTENS/NDI/NSHR to avoid writing components that don’t exist.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant