<!-- source-page: 331 -->

# 1.1.51 UPSD: User subroutine to define the frequency dependence for random response loading.

Product: Abaqus/Standard

# References

• “Random response analysis,” Section 6.3.11 of the Abaqus Analysis User’s Guide   
• \*RANDOM RESPONSE   
• \*PSD-DEFINITION   
• “Random response to jet noise excitation,” Section 1.4.10 of the Abaqus Benchmarks Guide

# Overview

User subroutine UPSD:

• will be called once for each frequency at which calculations will be made during a random response analysis if the frequency function is defined in a user subroutine;   
• is used to define complicated frequency dependencies for the cross-spectral density matrix of the random loading; and   
• ignores any data given for the associated frequency function outside the user subroutine.

# User subroutine interface

```fortran
SUBROUTINE UPSD(PSD,PSDR,PSDI,FREQ,KSTEP)
C
INCLUDE 'ABA_PARAM.INC'
C
CHARACTER*80 PSD
user coding to define PSDR and PSDI
RETURN
END 
```

# Variables to be defined

# PSDR

Real part of the frequency function at this frequency.

<!-- source-page: 332 -->

# PSDI

Imaginary part of the frequency function at this frequency.

# Variables passed in for information

# PSD

User-specified name for this frequency function definition, left justified.

# FREQ

Frequency, in radians per time.

# KSTEP

Step number.

<!-- source-page: 333 -->

# 1.1.52 URDFIL: User subroutine to read the results file.

# Product: Abaqus/Standard

# References

• “Results file output format,” Section 5.1.2 of the Abaqus Analysis User’s Guide   
• “Accessing the results file information,” Section 5.1.3 of the Abaqus Analysis User’s Guide   
• “Utility routines for accessing the results file,” Section 5.1.4 of the Abaqus Analysis User’s Guide

# Overview

User subroutine URDFIL:

• can be used to access the results file during an analysis;   
• is called at the end of any increment in which new information is written to the results file;   
• must call the utility routine DBFILE to read records from the results file (see “Utility routines for accessing the results file,” Section 5.1.4 of the Abaqus Analysis User’s Guide);   
• can call the utility routine POSFIL to read from the results file starting at a specified step and increment as opposed to the beginning of the file, which would otherwise be done (see “Utility routines for accessing the results file,” Section 5.1.4 of the Abaqus Analysis User’s Guide);   
• can force an analysis to terminate upon completion of a call by means of the variable LSTOP;   
• allows the last increment written to the results file to be overwritten by means of the variable LOVRWRT; and   
• allows access to the complete results file in a restarted job if the new results file is being appended to the old results file (see the description of the execution option fil in “Abaqus/Standard, Abaqus/Explicit, and Abaqus/CFD execution,” Section 3.2.2 of the Abaqus Analysis User’s Guide).

# User subroutine interface

```txt
SUBROUTINE URDFIL(LSTOP,LOVRWRT,KSTEP,KINC,DTIME,TIME)
C
INCLUDE 'ABA_PARAM.INC'
C
DIMENSION ARRAY(513),JRRAY(NPRECD,513),TIME(2)
EQUIVALENCE (ARRAY(1),JRRAY(1,1))
user coding to read the results file
RETURN
END 
```

<!-- source-page: 334 -->

# In all cases

# LSTOP

Flag to indicate whether an analysis should continue. The analysis will be terminated if LSTOP is set to 1. Otherwise, the analysis will continue.

# LOVRWRT

Flag to indicate that the information written to the results file for the increment can be overwritten. If LOVRWRT is set to 1, information for the current increment will be overwritten by information written to the results file in a subsequent increment unless the current increment is the final increment written to the results file. The purpose of this flag is to reduce the size of the results file by allowing information for an increment to be overwritten by information for a subsequent increment.

# DTIME

Time increment. This variable allows you to provide input to the automatic time incrementation algorithms in Abaqus (if automatic time incrementation is chosen). It is passed in as the value of the next time increment to be taken and can be updated to increase or reduce the time increment. If automatic time incrementation is not selected in the analysis procedure, updated values of DTIME are ignored.

# Only if utility routine POSFIL is called

# NSTEP

Desired step at which file reading will begin via utility routine DBFILE. If NSTEP is set to 0, the first available step will be read.

# NINC

Desired increment at which file reading will begin via utility routine DBFILE. If NINC is set to 0, the first available increment of the specified step will be read.

# Variables passed in for information

# KSTEP

Step number.

# KINC

Increment number.

# TIME(1)

Value of the step time at the end of the increment.

# TIME(2)

Value of the total time at the end of the increment.

<!-- source-page: 335 -->

Example: Terminating an analysis upon exceeding a Mises stress limit

The example below reads the values of Mises stress for the current increment from record 12 in the results file and terminates the analysis if any of the values of Mises stress written to the results file exceed 2.09 $\times 1 0 ^ { 8 }$ . Here, POSFIL is used to position you to read from the current increment.

```fortran
SUBROUTINE URDFIL(LSTOP,LOVRWRT,KSTEP,KINC,DTIME,TIME)
C
INCLUDE 'ABA_PARAM.INC'
C
DIMENSION ARRAY(513),JRRAY(NPRECD,513),TIME(2)
EQUIVALENCE (ARRAY(1),JRRAY(1,1))
PARAMETER(TOL=2.09D8)
C
C FIND CURRENT INCREMENT.
C
CALL POSFIL(KSTEP,KINC,ARRAY,JRCD)
DO K1=1,999999
CALL DBFILE(0,ARRAY,JRCD)
IF (JRCD .NE. 0) GO TO 110
KEY=JRRAY(1,2)
C
C RECORD 12 CONTAINS VALUES FOR SINV
C
IF (KEY.EQ.12) THEN
IF (ARRAY(3).GT.TOL) THEN
LSTOP=1
GO TO 110
END IF
END IF
END DO
110 CONTINUE
C
RETURN
END 
```  
Example: Terminating an analysis when the maximum Mises stress value stops increasing

This example demonstrates the use of URDFIL and POSFIL to stop an analysis when the maximum value of Mises stress in the model does not increase from one increment in the results file to the next. A data statement is used to save the maximum Mises stress value from the last increment. LOVRWRT is also used in this case to overwrite an increment in the results file once it has been read in URDFIL.

<!-- source-page: 336 -->

The subroutine shown below must be modified to define the maximum Mises stress in the data statement each time a job is restarted. This can be avoided by removing the LOVRWRT=1 statement and recoding the routine to read both the previous and the current increment to check that the Mises stress increases from one increment to the next (in this case you must correctly handle the first increment written to the results file as there will be no previous increment). The results file must also be properly appended on restart if you wish to compare the values of Mises stress between the first increment of a restart and the final increment of the job being restarted. This approach has the disadvantage that the results file may become quite large, as no information in the file will be overwritten.

```csv
SUBROUTINE URDFIL(LSTOP,LOVRWRT,KSTEP,KINC,DTIME,TIME)
C
INCLUDE 'ABA_PARAM.INC'
C
DIMENSION ARRAY(513),JRRAY(NPRECD,513),TIME(2)
EQUIVALENCE (ARRAY(1),JRRAY(1,1))
C
C INITIALIZE THE OLD MAXIMUM. FOR A JOB THAT IS BEING RESTARTED
C THIS VALUE SHOULD BE SET TO THE MAXIMUM MISES STRESS IN THE
C ORIGINAL ANALYSIS.
C
DATA OLDMAX/-1.D0/
C
CURRMAX = 0.D0
C
C FIND CURRENT INCREMENT.
C
CALL POSFIL(KSTEP,KINC,ARRAY,JRCD)
C
C SEARCH FOR THE HIGHEST VALUE OF MISES STRESS
C AND STORE THIS IN CURRMAX
C
DO K1=1,999999
CALL DBFILE(0,ARRAY,JRCD)
IF (JRCD.NE.0) GO TO 110
KEY=JRRAY(1,2)
IF (KEY.EQ.12) THEN
IF (ARRAY(3).GT.CURRMAX) CURRMAX=ARRAY(3)
END IF
END DO
110 CONTINUE
C
C COMPLETED READING OF CURRENT INCREMENT. NOW CHECK TO
C SEE IF VALUE OF MISES STRESS HAS INCREASED SINCE 
```

<!-- source-page: 337 -->

```txt
C LAST INCREMENT
C
IF (CURRMAX.LE.OLDMAX) LSTOP=1
OLDMAX=CURRMAX
LOVRWRT=1
C
RETURN
END
```

<!-- source-page: 338 -->

<!-- source-page: 339 -->

# 1.1.53 USDFLD: User subroutine to redefine field variables at a material point.

# Product: Abaqus/Standard

# References

• “Obtaining material point information in an Abaqus/Standard analysis,” Section 2.1.6   
• “Material data definition,” Section 21.1.2 of the Abaqus Analysis User’s Guide   
• \*USER DEFINED FIELD   
• “Damage and failure of a laminated composite plate,” Section 1.1.14 of the Abaqus Example Problems Guide   
• “USDFLD,” Section 4.1.24 of the Abaqus Verification Guide

# Overview

User subroutine USDFLD:

• allows you to define field variables at a material point as functions of time or of any of the available material point quantities listed in the Output Variable Identifiers table (“Abaqus/Standard output variable identifiers,” Section 4.2.1 of the Abaqus Analysis User’s Guide) except the user-defined output variables UVARM and UVARMn;   
• can be used to introduce solution-dependent material properties since such properties can easily be defined as functions of field variables;   
• will be called at all material points of elements for which the material definition includes userdefined field variables;   
• must call utility routine GETVRM to access material point data;   
• can use and update state variables; and   
• can be used in conjunction with user subroutine UFIELD to prescribe predefined field variables.

# Explicit solution dependence

Since this routine provides access to material point quantities only at the start of the increment, the solution dependence introduced in this way is explicit: the material properties for a given increment are not influenced by the results obtained during the increment. Hence, the accuracy of the results depends on the size of the time increment. Therefore, you can control the time increment in this routine by means of the variable PNEWDT.

# Defining field variables

Before user subroutine USDFLD is called, the values of the field variables at the material point are calculated by interpolation from the values defined at the nodes. Any changes to the field variables in the user subroutine are local to the material point: the nodal field variables retain the values defined

<!-- source-page: 340 -->

as initial conditions, predefined field variables, or in user subroutine UFIELD. The values of the field variables defined in this routine are used to calculate values of material properties that are defined to depend on field variables and are passed into other user subroutines that are called at the material point, such as the following:

• CREEP   
• HETVAL   
• UEXPAN   
• UHARD   
• UHYPEL   
• UMAT   
• UMATHT   
• UTRS

Output of the user-defined field variables at the material points can be obtained with the element integration point output variable FV (see “Abaqus/Standard output variable identifiers,” Section 4.2.1 of the Abaqus Analysis User’s Guide).

# Accessing material point data

You are provided with access to the values of the material point quantities at the start of the increment (or in the base state in a linear perturbation step) through the utility routine GETVRM described in “Obtaining material point information in an Abaqus/Standard analysis,” Section 2.1.6. The values of the material point quantities are obtained by calling GETVRM with the appropriate output variable keys. The values of the material point data are recovered in the arrays ARRAY, JARRAY, and FLGRAY for floating point, integer, and character data, respectively. You may not get values of some material point quantities that have not been defined at the start of the increment; e.g., ER.

# State variables

Since the redefinition of field variables in USDFLD is local to the current increment (field variables are restored to the values interpolated from the nodal values at the start of each increment), any history dependence required to update material properties by using this subroutine must be introduced with userdefined state variables.

The state variables can be updated in USDFLD and then passed into other user subroutines that can be called at this material point, such as those listed above. You specify the number of such state variables, as shown in the example at the end of this section (see also “Allocating space” in “User subroutines: overview,” Section 18.1.1 of the Abaqus Analysis User’s Guide).

# User subroutine interface

SUBROUTINE USDFLD(FIELD,STATEV,PNEWDT,DIRECT,T,CELENT,1 TIME,DTIME,CMNAME,ORNAME,NFIELD,NSTATV,NOEL,NPT,LAYER,
