ABAQUSNL user materials: umat_abaqusnl.f never sets U0, so the STRESS passed to the UMAT is undefined

Summary

For a material named ABAQUSNL..., umat_abaqusnl.f passes the UMAT the corotational Cauchy stress at the start of the increment. It computes this from the stored PK2 stress as s’ = J0^-1 U0 S U0^T. U0, the right stretch tensor at the start of the increment, is declared (u0(3,3)) but nothing assigns it. Commit 19656d2 (3 Nov 2023, “worked on umat_abaqusnl_total.f and umat_abaqusnl.f (consistent tangent)”) replaced the Simo-Hughes stretch-tensor block with an eigen-decomposition and dropped the nine u0(i,j)=u(k) assignments with it. Since then the incoming STRESS has been computed from an uninitialised local array.

A UMAT that computes the total stress from STRAN+DSTRAN, like the shipped example umat.f, never reads STRESS and is unaffected, so the test examples pass. A UMAT that updates the incoming STRESS gives wrong results under NLGEOM. That covers plasticity, damage and hypoelasticity, i.e. the usual Abaqus UMAT. umat_abaqus.f (the ABAQUS interface) does not use U0 and is not affected. Master (9ba5d76, 16 Oct 2026) still has the bug.

Version

ccx 2.23 (conda-forge build pl5321h484372f_2, macOS arm64). Source: src/umat_abaqusnl.f in 2.23 and in master.

Already reported or fixed?

Not reported: there is no matching GitHub issue (open or closed) or open pull request in Dhondtguido/CalculiX, and no calculix.discourse.group topic (searched 19 Oct 2026). Not fixed: master’s umat_abaqusnl.f still has no U0 assignment. A stock binary (conda-forge build 2 or 8) cannot show it, because the shipped example UMAT computes the total stress; the reproduction needs a ccx built with an incremental UMAT such as the one below.

Minimal input

The UMAT is a J2 law: isotropic elasticity, linear isotropic hardening, radial return and a consistent tangent. PROPS = E, nu, SY0, H; it has 7 state variables. Save it as src/umat.f:

C     Test UMAT for ccx's Abaqus-UMAT interface:
C     isotropic elasticity and J2 plasticity with linear isotropic
C     hardening, small strain, radial return, consistent tangent.
C     PROPS:  E, NU, SY0 (initial yield stress), H (hardening modulus)
C     STATEV: 1-6 plastic strain (shear as engineering strain),
C             7 equivalent plastic strain
      SUBROUTINE UMAT(STRESS,STATEV,DDSDDE,SSE,SPD,SCD,RPL,DDSDDT,
     1 DRPLDE,DRPLDT,STRAN,DSTRAN,TIME,DTIME,TEMP,DTEMP,PREDEF,DPRED,
     2 CMNAME,NDI,NSHR,NTENS,NSTATV,PROPS,NPROPS,COORDS,DROT,PNEWDT,
     3 CELENT,DFGRD0,DFGRD1,NOEL,NPT,LAYER,KSPT,KSTEP,KINC)
      IMPLICIT REAL*8(A-H,O-Z)
      CHARACTER*80 CMNAME
      DIMENSION STRESS(NTENS),STATEV(NSTATV),DDSDDE(NTENS,NTENS),
     1 DDSDDT(NTENS),DRPLDE(NTENS),STRAN(NTENS),DSTRAN(NTENS),
     2 TIME(2),PREDEF(1),DPRED(1),PROPS(NPROPS),COORDS(3),DROT(3,3),
     3 DFGRD0(3,3),DFGRD1(3,3)
      DIMENSION S(6),EN(6)
C
      IF (NDI.NE.3 .OR. NSHR.NE.3) THEN
        WRITE(*,*) 'UMAT J2: only 3-D stress states (NTENS=6)'
        STOP
      END IF
      E=PROPS(1)
      XNU=PROPS(2)
      SY0=PROPS(3)
      H=PROPS(4)
      G=E/(2.D0*(1.D0+XNU))
      BK=E/(3.D0*(1.D0-2.D0*XNU))
      XLAM=BK-2.D0*G/3.D0
C     elastic stiffness
      DO I=1,6
        DO J=1,6
          DDSDDE(I,J)=0.D0
        END DO
      END DO
      DO I=1,3
        DO J=1,3
          DDSDDE(I,J)=XLAM
        END DO
        DDSDDE(I,I)=XLAM+2.D0*G
        DDSDDE(I+3,I+3)=G
      END DO
C     elastic trial stress
      DO I=1,6
        DO J=1,6
          STRESS(I)=STRESS(I)+DDSDDE(I,J)*DSTRAN(J)
        END DO
      END DO
C     trial deviator, its norm and the Mises stress
      P=(STRESS(1)+STRESS(2)+STRESS(3))/3.D0
      DO I=1,3
        S(I)=STRESS(I)-P
        S(I+3)=STRESS(I+3)
      END DO
      SNORM=SQRT(S(1)**2+S(2)**2+S(3)**2
     1      +2.D0*(S(4)**2+S(5)**2+S(6)**2))
      Q=SQRT(1.5D0)*SNORM
      PEEQ=STATEV(7)
      SY=SY0+H*PEEQ
      IF (Q.LE.SY) RETURN
C     radial return: plastic strain increment DP*SQRT(3/2)*N
      DP=(Q-SY)/(3.D0*G+H)
      DO I=1,6
        EN(I)=S(I)/SNORM
      END DO
      FAC=2.D0*G*DP*SQRT(1.5D0)
      DO I=1,6
        STRESS(I)=STRESS(I)-FAC*EN(I)
      END DO
      DO I=1,3
        STATEV(I)=STATEV(I)+DP*SQRT(1.5D0)*EN(I)
        STATEV(I+3)=STATEV(I+3)+2.D0*DP*SQRT(1.5D0)*EN(I+3)
      END DO
      STATEV(7)=PEEQ+DP
C     consistent tangent K 1x1 + 2G B Idev - 2G C NxN
      B=1.D0-3.D0*G*DP/Q
      C=3.D0*G/(3.D0*G+H)-3.D0*G*DP/Q
      DO I=1,6
        DO J=1,6
          DDSDDE(I,J)=0.D0
        END DO
      END DO
      DO I=1,3
        DO J=1,3
          DDSDDE(I,J)=BK-2.D0*G*B/3.D0
        END DO
        DDSDDE(I,I)=BK+4.D0*G*B/3.D0
        DDSDDE(I+3,I+3)=G*B
      END DO
      DO I=1,6
        DO J=1,6
          DDSDDE(I,J)=DDSDDE(I,J)-2.D0*G*C*EN(I)*EN(J)
        END DO
      END DO
      RETURN
      END

j2_umat.inp is a unit cube stretched uniaxially to lambda = 1.02 in 10 increments, with NLGEOM:

*HEADING
Unit cube, uniaxial stretch to 1.02 in 10 increments, NLGEOM, J2 UMAT (ABAQUSNL)
*NODE
1, 0., 0., 0.
2, 1., 0., 0.
3, 1., 1., 0.
4, 0., 1., 0.
5, 0., 0., 1.
6, 1., 0., 1.
7, 1., 1., 1.
8, 0., 1., 1.
*ELEMENT, TYPE=C3D8, ELSET=EALL
1, 1, 2, 3, 4, 5, 6, 7, 8
*NSET, NSET=X0
1, 4, 5, 8
*NSET, NSET=X1
2, 3, 6, 7
*NSET, NSET=Y0
1, 2, 5, 6
*NSET, NSET=Z0
1, 2, 3, 4
*MATERIAL, NAME=ABAQUSNLJ2
*USER MATERIAL, CONSTANTS=4
200000., 0.3, 250., 2000.
*DEPVAR
7
*SOLID SECTION, ELSET=EALL, MATERIAL=ABAQUSNLJ2
*BOUNDARY
X0, 1, 1
Y0, 2, 2
Z0, 3, 3
*STEP, NLGEOM, INC=100
*STATIC, DIRECT
0.1, 1.
*BOUNDARY
X1, 1, 1, 0.02
*NODE PRINT, NSET=X1, TOTALS=ONLY
RF
*EL PRINT, ELSET=EALL
S
*END STEP

The reference j2_builtin.inp is the same deck with ccx’s own law in place of the user material:

*MATERIAL, NAME=J2
*ELASTIC
200000., 0.3
*PLASTIC
250., 0.
2250., 1.
*SOLID SECTION, ELSET=EALL, MATERIAL=J2

How to run

Build ccx with the UMAT above as src/umat.f, then run ccx j2_umat. The reference runs on any ccx: ccx j2_builtin.

Expected

The ABAQUSNL interface passes the corotational logarithmic strain. For this UMAT in uniaxial tension that gives, once yielded, sigma11 = (E H ln(lambda) + E SY0)/(E + H). The reaction is sigma11 * lambda_lat^2, where the lateral log strain is -nu sigma11/E - eps_p/2.

t lambda sigma11, analytic RF, analytic sigma11, j2_builtin RF, j2_builtin
0.1 1.002 251.48 251.11 251.48 251.11
0.5 1.010 267.23 264.72 267.26 264.76
1.0 1.020 286.74 281.28 286.82 281.35

ccx’s own finite-strain *PLASTIC agrees with the log-strain J2 answer to within 3e-4.

Actual

I could not run the UMAT case here, because it needs a ccx build. These numbers come from an earlier build of ccx 2.23 from source with this UMAT. The model was a C3D8 cantilever (20 x 4 x 2 elements, NLGEOM, tip deflection about 5 times the first-yield deflection in 20 increments). The summed tip reaction stayed near its first-increment value, -280 … -367, against -1212 at the end for the same model with *ELASTIC/*PLASTIC: 70 % low, consistent with a zero incoming STRESS in that build. With U0 set as in the fix below, the reaction matched *ELASTIC/*PLASTIC within 2.0e-5 at every increment. Without NLGEOM (ABAQUS interface) the same UMAT reproduced *ELASTIC/*PLASTIC exactly.

A total-form UMAT gets the right answer through the same interface. I ran the distributed binary with its shipped total-form umat.f on the same cube with *USER MATERIAL, CONSTANTS=2 / 1000., 0.3 (material ABAQUSNLLIN), stretched to lambda = 1.2 in 10 increments. It gives sigma11 = 182.3216 = 1000 ln 1.2 and a total reaction 163.4291 = sigma11 * 1.2^(-0.6), the exact answer, because that UMAT never reads the incoming stress.

Where it goes wrong

src/umat_abaqusnl.f, the same lines in 2.23 and master. u0 appears only in its declaration (line 151) and in lines 533-578:

!     calculate the total right stretch tensor at the start
!     of the increment (= mechanical right stretch tensor
!     multiplied with the expansion at the start of the increment)
!
      do i=1,3
        do j=1,3
          u0(i,j)=u0(i,j)*expansion
        enddo
      enddo
!
      if(iorien.ne.0) then
        do i=1,3
          do j=1,3
            tkl(i,j)=u0(i,1)*skl(j,1)+u0(i,2)*skl(j,2)+
     &           u0(i,3)*skl(j,3)
          enddo
        enddo
      else
        do i=1,3
          do j=1,3
            tkl(i,j)=u0(i,j)
          enddo
        enddo
      endif
      ...
            stre(jj)=stre(jj)+
     &           xa(j3,j4)*tkl(j1,j3)*tkl(j2,j4)
      ...
        stre(jj)=stre(jj)/voj

Up to 4437a00, the routine set U0 right after computing U with the Simo-Hughes formula:

      u0(1,1)=u(1)
      u0(2,2)=u(2)
      u0(3,3)=u(3)
      u0(1,2)=u(4)
      ...

Fix

Set U0 = sum_i lambda_i N_i (x) N_i from the start-of-increment eigen-decomposition the routine already does. Put it right after the first um1(3,2)=um1(2,3) (line 295). At that point xm1..xm3 and wum1 (= 1/lambda_i) still hold the start-of-increment values:

!     right stretch tensor at the start of the increment
      do jj=1,6
        u0(kal(1,jj),kal(2,jj))=xm1(jj)/wum1(1)+xm2(jj)/wum1(2)
     &       +xm3(jj)/wum1(3)
        u0(kal(2,jj),kal(1,jj))=u0(kal(1,jj),kal(2,jj))
      enddo

This is the change that brought the cantilever above to within 2e-5 of *ELASTIC/*PLASTIC.

Unfortunately, I can’t compile CalculiX on Windows (no idea how to do it). I only compiled on Ubuntu VM via https://www.feacluster.com/install/install (but it still points to ccx 2.22).

So maybe someone else could check it (or help me do it). Otherwise, I would still report it on GitHub because it includes such a detailed diagnosis.

I can wait a few days to see if anyone can reproduce it before posting on GitHub :slight_smile:

1 Like

Sure, let’s do it this way. Thanks for so efficient collaboration on this bug reporting.

1 Like

I ran both above inp files with the

  1. current ccx 2.23 version subroutine umat_abaqusnl()
  2. fix for u0 as described above and rebuilt ccx

Below the last increment number 10 for all 4 dat files which confirms that:

  1. the fix provides same stresses and forces for the umat_abaqusnl() version for both inp files
  2. the fix provides same stresses and forces for both inp files as the current 2.23 version ran with j2_builtin.inp.

j2_builtin.dat with the u0 fix in umat_abaqusnl.f:

INCREMENT    10

total force (fx,fy,fz) for set X1 and time  0.1000000E+01

    2.813528E+02  1.180388E-17 -1.355833E-14

stresses (elem, integ.pnt.,sxx,syy,szz,sxy,sxz,syz) for set EALL and time  0.1000000E+01

     1   1  2.868153E+02 -3.092352E-07 -3.092352E-07  6.031401E-16  6.882387E-16  1.621198E-15
     1   2  2.868153E+02 -3.092352E-07 -3.092352E-07  6.031401E-16 -1.610121E-14 -1.265788E-15
     1   3  2.868153E+02 -3.092352E-07 -3.092352E-07  8.847652E-16  1.628297E-15  2.365918E-14
     1   4  2.868153E+02 -3.092352E-07 -3.092352E-07  8.847652E-16 -4.551090E-14  1.239489E-14
     1   5  2.868153E+02 -3.092352E-07 -3.092352E-07  8.767223E-16 -1.092586E-14  2.579101E-15
     1   6  2.868153E+02 -3.092352E-07 -3.092352E-07 -5.051540E-14 -2.771531E-14  1.463091E-14
     1   7  2.868153E+02 -3.092352E-07 -3.092352E-07  6.810872E-15  3.249672E-15  2.461709E-14
     1   8  2.868153E+02 -3.092352E-07 -3.092352E-07  3.994826E-14 -1.588549E-14  2.829159E-14

j2_umat.dat with the u0 fix in umat_abaqusnl.f:

INCREMENT    10

total force (fx,fy,fz) for set X1 and time  0.1000000E+01

    2.812768E+02  2.232081E-13  2.580169E-13

stresses (elem, integ.pnt.,sxx,syy,szz,sxy,sxz,syz) for set EALL and time  0.1000000E+01

     1   1  2.867379E+02 -8.526513E-14  1.136868E-13 -1.315306E-13  1.819604E-14 -9.598424E-14
     1   2  2.867379E+02  2.216893E-12  1.136868E-13  2.097022E-13  6.788857E-14  3.496746E-15
     1   3  2.867379E+02  2.245315E-12  2.131628E-12  2.485920E-14  1.282584E-13  1.889339E-14
     1   4  2.867379E+02  3.410605E-13  7.105427E-13  8.617971E-14  8.111215E-14 -6.413343E-17
     1   5  2.867379E+02  2.415845E-12  2.160050E-12  1.487958E-13  4.125170E-13  5.077658E-14
     1   6  2.867379E+02  1.676881E-12  1.705303E-12  4.235210E-13  3.627301E-13  1.187354E-13
     1   7  2.867379E+02  1.108447E-12  1.477929E-12  4.475686E-13  5.294210E-13  4.910307E-14
     1   8  2.867379E+02  9.379164E-13  4.547474E-13  6.112379E-13  5.040877E-13 -1.476897E-13

j2_builtin.dat with the original 2.23 umat_abaqusnl.f:

INCREMENT    10

total force (fx,fy,fz) for set X1 and time  0.1000000E+01

    2.813528E+02  1.180388E-17 -1.355833E-14

stresses (elem, integ.pnt.,sxx,syy,szz,sxy,sxz,syz) for set EALL and time  0.1000000E+01

     1   1  2.868153E+02 -3.092352E-07 -3.092352E-07  6.031401E-16  6.882387E-16  1.621198E-15
     1   2  2.868153E+02 -3.092352E-07 -3.092352E-07  6.031401E-16 -1.610121E-14 -1.265788E-15
     1   3  2.868153E+02 -3.092352E-07 -3.092352E-07  8.847652E-16  1.628297E-15  2.365918E-14
     1   4  2.868153E+02 -3.092352E-07 -3.092352E-07  8.847652E-16 -4.551090E-14  1.239489E-14
     1   5  2.868153E+02 -3.092352E-07 -3.092352E-07  8.767223E-16 -1.092586E-14  2.579101E-15
     1   6  2.868153E+02 -3.092352E-07 -3.092352E-07 -5.051540E-14 -2.771531E-14  1.463091E-14
     1   7  2.868153E+02 -3.092352E-07 -3.092352E-07  6.810872E-15  3.249672E-15  2.461709E-14
     1   8  2.868153E+02 -3.092352E-07 -3.092352E-07  3.994826E-14 -1.588549E-14  2.829159E-14

j2_umat.dat with the original 2.23 umat_abaqusnl.f:

INCREMENT    10

total force (fx,fy,fz) for set X1 and time  0.1000000E+01

    2.599909E+02 -1.979230E-13 -1.045469E-13

stresses (elem, integ.pnt.,sxx,syy,szz,sxy,sxz,syz) for set EALL and time  0.1000000E+01

     1   1  2.638270E+02 -3.204548E-12 -2.771117E-12  2.249071E-13 -2.368769E-14 -1.067226E-14
     1   2  2.638270E+02 -6.252776E-12 -5.471179E-12 -1.567229E-13 -4.509817E-14  8.537807E-14
     1   3  2.638270E+02  8.895995E-12  3.439027E-12 -1.804064E-13 -4.205973E-14 -1.109915E-12
     1   4  2.638270E+02 -3.488765E-12 -3.062439E-12 -1.623583E-13 -1.278274E-13  4.785075E-29
     1   5  2.638270E+02 -7.922552E-12 -7.318590E-12 -4.769567E-13 -8.426155E-14  4.268903E-14
     1   6  2.638270E+02 -3.019807E-12 -2.430056E-12 -3.725460E-13 -1.056720E-13  2.561342E-13
     1   7  2.638270E+02 -3.964828E-12 -3.424816E-12 -2.151555E-13 -2.101384E-13 -4.268903E-14
     1   8  2.638270E+02 -2.636114E-12 -1.946887E-12 -2.675080E-13 -2.099708E-13 -1.280671E-13
1 Like