Programer's Manual For ANSYS PDF
Programer's Manual For ANSYS PDF
ANSYS
002328
January 2007
ANSYS, ANSYS Workbench, AUTODYN, CFX, FLUENT and any and all ANSYS, Inc. brand, product, service and feature names, logos and slogans are registered
trademarks or trademarks of ANSYS, Inc. or its subsidiaries located in the United States or other countries. ICEM CFD is a trademark used by ANSYS, Inc.
under license. All other brand, product, service and feature names or trademarks are the property of their respective owners.
Disclaimer Notice
THIS ANSYS SOFTWARE PRODUCT AND PROGRAM DOCUMENTATION INCLUDE TRADE SECRETS AND ARE CONFIDENTIAL AND PROPRIETARY PRODUCTS
OF ANSYS, INC., ITS SUBSIDIARIES, OR LICENSORS.The software products and documentation are furnished by ANSYS, Inc., its subsidiaries, or affiliates
under a software license agreement that contains provisions concerning non-disclosure, copying, length and nature of use, compliance with exporting
laws, warranties, disclaimers, limitations of liability, and remedies, and other provisions.The software products and documentation may be used, disclosed,
transferred, or copied only in accordance with the terms and conditions of that software license agreement.
ANSYS, Inc. and ANSYS Europe, Ltd. are UL registered ISO 9001:2000 Companies.
Third-Party Software
See the online documentation in the product help files for the complete Legal Notice for ANSYS proprietary software and third-party software.The ANSYS
third-party software information is also available via download from the Customer Portal on the ANSYS web page. If you are unable to access the third-
party legal notices, please contact ANSYS, Inc.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. v
Programmer's Manual for ANSYS
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
vi Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
Programmer's Manual for ANSYS
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. vii
Programmer's Manual for ANSYS
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
viii Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
Programmer's Manual for ANSYS
6.3.6. Function userpe (Calculating Rotation Caused by Internal Pressure) ................................ 150
6.3.7. Subroutine UElMatx (Accessing Element Matrices and Load Vectors) ............................... 151
6.3.8. Subroutine UTHICK (Getting User-defined Initial Thickness) ............................................. 151
6.3.9. Subroutine USTRESS (Getting User-defined Initial Stress) ................................................. 152
6.3.10. Subroutine UsrFictive (Providing User-defined Fictive Temperature Relationship) ........... 152
6.3.11. Subroutine UsrViscEl (Performs Viscoelastic Computation) ............................................ 153
6.3.12. Subroutine usrsurf116 (Modifying SURF151 and SURF152 Film Coefficients and Bulk
Temperatures) ........................................................................................................................ 154
6.3.13. Subroutine User116Cond (Computes the conductance coefficient for FLUID116) ........... 155
6.3.14. Subroutine User116Hf (Computes the film coefficient for FLUID116) .............................. 155
6.3.15. Subroutine Us_Surf_Str (Captures surface stresses) ....................................................... 156
6.3.16. Subroutine usflex (Computes the flexibility factor for PIPE16, PIPE17, PIPE18, and
PIPE60) ................................................................................................................................... 156
6.3.17. Subroutine UsrShift (Calculates pseudotime time increment) ........................................ 157
6.4. Routines for Customizing Material Behavior ............................................................................. 157
6.4.1. Subroutine usermat (Writing Your Own Material Models) ................................................ 157
6.4.2. Subroutine userpl (Writing Your Own Plasticity Laws) ...................................................... 160
6.4.3. Subroutines usercreep and usercr (Defining Viscoplastic/Creep Material Behavior) .......... 161
6.4.3.1. Creep Subroutine usercreep .................................................................................. 162
6.4.3.2. Creep Subroutine usercr ........................................................................................ 163
6.4.4. Subroutine usersw (Writing Your Own Swelling Laws) ..................................................... 164
6.4.5. Subroutine UserHyper (Writing Your Own Hyperelasticity Laws) ...................................... 165
6.4.6. Subroutine uservp (Updating Nonlinear Strain History for Materials) ............................... 166
6.4.7. Subroutine userck (Checking User-Defined Material Data) ............................................... 167
6.4.8. Subroutine usermc (Controlling Hygrothermal Growth) .................................................. 167
6.4.9. Subroutine usrfc6 (Defining Custom Failure Criteria) ....................................................... 168
6.4.10. Subroutines usrfc1 through usrfc5 ................................................................................ 168
6.4.11. Subroutine UserVisLaw (Defining Viscosity Laws) .......................................................... 168
6.4.12. Supporting Function egen ............................................................................................ 169
6.5. Routines for Customizing Loads .............................................................................................. 170
6.5.1. Subroutine usrefl (Changing Scalar Fields to User-Defined Values) ................................... 170
6.5.2. Subroutine userpr (Changing Element Pressure Information) ........................................... 171
6.5.3. Subroutine usercv (Changing Element Face Convection Surface Information) .................. 171
6.5.4. Subroutine userfx (Changing Element Face Heat Flux Surface Information) ...................... 172
6.5.5. Subroutine userch (Changing Element Face Charge Density Surface Information) ............ 173
6.6. Running ANSYS as a Subroutine .............................................................................................. 174
6.7. Defining Your Own Commands ............................................................................................... 174
6.7.1. Function user01 ............................................................................................................. 175
6.7.2. Function user02 (Demonstrates Offsetting Selected Nodes) ............................................ 176
6.7.3. Function user03 (Demonstrates Using ANSYS Memory) ................................................... 177
6.7.4. Function user04 ............................................................................................................. 179
6.7.5. Functions user05 through user10 ................................................................................... 181
6.8. Supporting Subroutines .......................................................................................................... 181
6.8.1. Function GetRForce (Getting Nodal Reaction Force values) .............................................. 181
6.8.2. Function GetStackDisp (Getting Current Displacement Values) ........................................ 181
6.8.3. Subroutine ElResultStrt (Getting Load Data from Analysis Results) ................................... 182
6.8.4. Subroutine ElResultGet (Getting Results Values at Selected Points) .................................. 182
6.8.5. Subroutine ElInterp (Finding Element Coordinates) ......................................................... 183
6.9. Access at the Beginning and End of Various Operations ........................................................... 183
6.10. Creating Your Own Optimization Routine .............................................................................. 184
6.10.1. Linking a Custom Optimization Program to ANSYS ........................................................ 185
6.10.2. Subroutine userop (Defining a Custom Optimization Routine) ....................................... 185
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. ix
Programmer's Manual for ANSYS
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
x Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
Programmer's Manual for ANSYS
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. xi
Programmer's Manual for ANSYS
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
xii Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
Programmer's Manual for ANSYS
7.9.25. eeliqr Function (Getting Information About an Element's Nodal Elastic Strains) .............. 242
7.9.26. eelget Function (Getting an Element's Nodal Elastic Strains) .......................................... 243
7.9.27. eelput Subroutine (Storing an Element's Nodal Elastic Strains) ....................................... 243
7.9.28. eeldel Subroutine (Deleting an Element's Nodal Elastic Strains) ..................................... 244
7.9.29. epliqr Function (Getting Information About an Element's Nodal Plastic Strains) ............. 244
7.9.30. eplget Function (Getting an Element's Nodal Plastic Strains) .......................................... 245
7.9.31. eplput Subroutine (Storing an Element's Nodal Plastic Strains) ...................................... 245
7.9.32. epldel Subroutine (Deleting an Element's Nodal Plastic Strains) ..................................... 246
7.9.33. ecriqr Function (Getting Information About an Element's Nodal Creep Strains) .............. 246
7.9.34. ecrget Function (Getting an Element's Nodal Creep Strains) ........................................... 246
7.9.35. ecrput Subroutine (Storing an Element's Nodal Creep Strains) ....................................... 247
7.9.36. ecrdel Subroutine (Deleting an Element's Nodal Creep Strains) ...................................... 248
7.9.37. ethiqr Function (Getting Information About an Element's Nodal Thermal Strains) ........... 248
7.9.38. ethget Function (Getting an Element's Nodal Thermal Stresses) ..................................... 248
7.9.39. ethput Subroutine (Storing an Element's Nodal Thermal Stresses) .................................. 249
7.9.40. ethdel Subroutine (Deleting an Element's Thermal, Initial, and Swelling Strains) ............. 250
7.9.41. euliqr Function (Getting Information About an Element's Euler Angles) ......................... 250
7.9.42. eulget Function (Getting an Element's Nodal Euler Angles) ............................................ 250
7.9.43. eulput Subroutine (Storing an Element's Euler Angles) .................................................. 251
7.9.44. euldel Subroutine (Deleting an Element's Euler Angles) ................................................. 251
7.9.45. efxiqr Function (Getting Information About Element Fluxes) .......................................... 251
7.9.46. efxget Function (Getting an Element Flux) .................................................................... 252
7.9.47. efxput Subroutine (Storing an Element's Fluxes) ............................................................ 252
7.9.48. efxdel Subroutine (Deleting Element Fluxes) ................................................................. 252
7.9.49. elfiqr Function (Getting Information About Element Local Forces) ................................. 252
7.9.50. elfget Function (Getting an Element Local Force) ........................................................... 253
7.9.51. elfput Subroutine (Storing an Element's Local Forces) .................................................... 253
7.9.52. elfdel Subroutine (Deleting Element Local Forces) ......................................................... 253
7.9.53. emniqr Function (Getting Information About Element Miscellaneous Non-summable
Data) ...................................................................................................................................... 254
7.9.54. emnget Function (Getting an Element's Miscellaneous Non-summable Data) ................ 254
7.9.55. emnput Subroutine (Storing an Element's Miscellaneous Non-summable Data) ............. 254
7.9.56. emndel Subroutine (Deleting an Element's Miscellaneous Non-summable Data) ........... 255
7.9.57. ecdiqr Function (Getting Information About Element Current Densities) ........................ 255
7.9.58. ecdget Function (Getting an Element Current Density) .................................................. 255
7.9.59. ecdput Subroutine (Storing an Element's Current Densities) .......................................... 255
7.9.60. ecddel Subroutine (Deleting Element Current Densities) ............................................... 256
7.9.61. enliqr Function (Getting Information About Element Nonlinear Tables) .......................... 256
7.9.62. enlget Function (Getting Element Nonlinear Tables) ...................................................... 256
7.9.63. enlput Subroutine (Storing an Element's Nonlinear Tables) ............................................ 257
7.9.64. enldel Subroutine (Deleting Element Nonlinear Tables) ................................................. 257
7.9.65. ehciqr Function (Getting Information About Calculated Element Heat Generations) ....... 257
7.9.66. ehcget Function (Getting a Calculated Element Heat Generation) .................................. 258
7.9.67. ehcput Subroutine (Storing an Element's Calculated Heat Generations) ......................... 258
7.9.68. ehcdel Subroutine (Deleting Element Calculated Heat Generations) .............................. 258
8. Subroutines for Users' Convenience ............................................................................................. 259
8.1. Input and Output Abbreviations .............................................................................................. 259
8.2. General Subroutines ............................................................................................................... 259
8.2.1. dptoch Subroutine (Retrieve Eight Characters From a Double Precision Variable) ............. 259
8.2.2. wrinqr Function (Obtain Information About Output) ....................................................... 259
8.2.3. erinqr Subroutine (Obtaining Information from the Errors Common) ............................... 260
8.2.4. TrackBegin Subroutine (Beginning Tracking for a Subroutine Call) ................................... 261
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. xiii
Programmer's Manual for ANSYS
8.2.5. TrackEnd Subroutine (Ending Tracking for a Subroutine Call) ........................................... 262
8.2.6. erhandler Subroutine (Displaying ANSYS Errors) .............................................................. 262
8.2.7. intrp Subroutine (Doing Single Interpolation) ................................................................. 263
8.2.8. tranx3 Subroutine (Processing Geometry for 3-D Line Elements) ...................................... 263
8.2.9. systop Subroutine (Stopping an ANSYS Program Run) ..................................................... 264
8.3. Vector Functions ..................................................................................................................... 264
8.3.1. vdot Function (Computing the Dot Product of Two Vectors) ............................................ 264
8.3.2. vsum Function (Summing Vector Components) .............................................................. 264
8.3.3. vmax Function (Retrieving the Maximum Vector Value at a Given Location) ..................... 265
8.3.4. lastv Function (Retrieving the Position of the Last Nonzero Term in a Double Precision
Vector) ................................................................................................................................... 265
8.3.5. izero Function (Setting an Integer Vector to Zero) ............................................................ 265
8.3.6. imove Function (Assigning Equal Values to Two Integer Vectors) ...................................... 265
8.3.7. vzero Subroutine (Initializing a Vector to Zero) ................................................................ 265
8.3.8. vmove Subroutine (Moving One Vector into Another) ..................................................... 266
8.3.9. vimove Subroutine (Moving One Vector into Another Incrementally) ............................... 266
8.3.10. vinit Subroutine (Assigning a Scalar Constant to a Vector) .............................................. 266
8.3.11. viinit Subroutine (Assigning a Scalar Constant to a Vector Incrementally) ....................... 266
8.3.12. vapb Subroutine (Setting a Vector to Sum of Two Vectors) ............................................. 267
8.3.13. vapb1 Subroutine (Combining Two Vectors in One) ....................................................... 267
8.3.14. vapcb1 Subroutine (Multiplying a Vector to a Constant) ................................................ 267
8.3.15. vamb Subroutine (Gets a Third Vector by Subtracting One Vector from Another) ............ 267
8.3.16. vamb1 Subroutine (Subtracting One Vector from Another) ............................................ 267
8.3.17. vmult Subroutine (Multiplying a Vector by a Constant) .................................................. 268
8.3.18. vmult1 Subroutine (Multiplying a Vector by a Constant) ................................................ 268
8.3.19. vcross Subroutine (Defining a Vector via a Cross Product) .............................................. 268
8.3.20. vnorme Subroutine (Normalizing a Three-Component Vector) ....................................... 268
8.3.21. vnorm Subroutine (Normalizing a Vector to Unit Length) ............................................... 269
8.3.22. ndgxyz Function (Getting the X,Y,Z Vector for a Node) ................................................... 269
8.3.23. ndpxyz Subroutine (Storing X,Y,Z for a Node) ................................................................ 269
8.4. Matrix Subroutines .................................................................................................................. 270
8.4.1. maxv Subroutine (Multiplying a Vector by a Matrix) ......................................................... 270
8.4.2. maxv1 Subroutine (Multiplying a Vector by a Matrix) ....................................................... 270
8.4.3. matxv Subroutine (Multiplying a Vector by a Full Transposed Matrix) ............................... 270
8.4.4. matxv1 Subroutine (Multiplying a Vector by a Full Transposed Matrix) ............................. 271
8.4.5. matxb Subroutine (Transposing a matrix) ....................................................................... 271
8.4.6. maat Subroutine (Changing a Matrix Value via Addition, Multiplication, and Transposi-
tion) ....................................................................................................................................... 271
8.4.7. matsym Subroutine (Filling the Upper Triangle from the Lower Triangle) .......................... 272
8.4.8. mctac Subroutine (Transposing a symmetric matrix) ....................................................... 272
8.4.9. tran Subroutine (Transposing a matrix) ........................................................................... 272
8.4.10. symeqn Subroutine (Solving Simultaneous Linear Equations) ........................................ 273
A. Creating External Commands in UNIX .............................................................................................. 275
A.1. Tasks in Creating an External Command .................................................................................. 275
A.1.1. Creating Compatible Code ............................................................................................. 275
A.1.2. Creating a Shared Library ............................................................................................... 276
A.1.3. Creating an External Table File ........................................................................................ 277
A.1.4. Setting the ANSYS_EXTERNAL_PATH Environment Variable ............................................. 278
A.1.5. Using External Commands ............................................................................................. 278
A.1.6. Checking External Command Status ............................................................................... 278
A.1.7. Resetting External Commands ....................................................................................... 278
B. Creating External Commands in Windows ........................................................................................ 279
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
xiv Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
Programmer's Manual for ANSYS
List of Figures
4.1. Display Format for Z-buffered Graphics ................................................................................................. 90
4.2. Example Display of a Graphics File ......................................................................................................... 95
List of Tables
6.1. ANSYS Exit Codes ................................................................................................................................ 174
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. xv
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
xvi Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
Preface
About the Programmer's Manual for ANSYS
The Programmer's Manual for ANSYS provides information about the various programming interfaces available
to customers.This manual assumes that you have at least a basic knowledge of programming (a working
knowledge of Fortran 90 would be very helpful).The two part manual includes:
In addition, you can find the ANSYS Parametric Design Language Guide (APDL) as part of the ANSYS online docu-
mentation.This guide was designed for ANSYS users that have some programming skills and wish to tap the
power of the ANSYS Parametric Design Language (APDL) to increase the productivity. APDL is a scripting language
that is very similar to Fortran 90.The guide describes how to define parameters (variables), how to create macro
programs using APDL, how to use APDL for simple user interaction, how to encrypt an APDL macro, and how to
debug an APDL macro.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. xvii
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
xviii Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
Part I, Guide to Interfacing with ANSYS
Chapter 1: Format of Binary Data Files
1.1. What Are ANSYS Binary Files?
The ANSYS program writes several binary files to store data during an analysis.These files are named Job-
name.ext, where Jobname is the name of the analysis that caused the file to be generated and .ext is an
extension indicating the type of data in the file. ANSYS-written binary files include the following:
The following results files, in which the ANSYS program stores the results of solving finite element analysis
problems:
Jobname.RST A structural or coupled-field analysis
Jobname.RTH A thermal analysis
Jobname.RMG A magnetic analysis
Jobname.RFL A FLOTRAN analysis
The Jobname.MODE file, storing data related to a modal analysis
The Jobname.RDSP file, storing data related to a reduced transient analysis.
The Jobname.RFRQ file, storing data related to a reduced harmonic analysis
The Jobname.EMAT file, storing data related to element matrices
The Jobname.SUB file, storing data related to substructure matrices
The Jobname.TRI file, storing the triangularized stiffness matrix
The Jobname.FULL file, storing the full stiffness-mass matrix
The files listed above cover almost all users' needs, although there are others. For more information, see the Basic
Analysis Guide.
Record ID is the identifier for this record. Not all records will have identifiers; they're indicated only for
records whose record pointers are stored in a header.
Type indicates what kind of information this record stores.
Number of records indicates how many records of this description are found here.
Record length indicates the number of items stored in the record.
In some record descriptions, actual variable names used may appear in the record contents area.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 3
Chapter 1: Format of Binary Data Files
Item 10 The ANSYS release level in integer form ("X.X" in character form)
Item 11 The date of the ANSYS release
Items 12-14 The machine identifier in integer form (three four-character strings)
Items 15-16 The Jobname in integer form (two four-character strings)
Items 17-18 The ANSYS product name in integer form (two four-character strings)
Item 19 The ANSYS special version label in integer form (one four-character string)
Items 20-22 The user name in integer form (three four-character strings)
Items 23-25 The machine identifier in integer form (three four-character strings)
Item 26 The system record size
Item 27 The maximum file length
Item 28 The maximum record number
Items 31-38 The Jobname (eight four-character strings)
Items 41-60 The main analysis title in integer form (20 four-character strings)
Items 61-80 The first subtitle in integer form (20 four-character strings)
Item 95 The split point of the file
Items 97-98 LONGINT of filesize at write
Note: The pointers in the solution data headers are relative , not absolute pointers. For example, the 12th item
in the solution data header will be relative to a position in the Data Set Index (ptrESL = DSI (i) + ptrESL).
This section explains the contents of the results file; that is, those files with the following extensions:
.rfl .brfl
.rmg .brmg
.rst .brst
.rth .brth
.lnn
1.2.1. Nomenclature
A load case contains the results for an instance in an analysis. A load case is defined by a load step number and
a substep number. A load case is also categorized by a cumulative iteration number and time (or frequency)
values. A load case is identified by all three methods in the results file.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
4 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
1.2.3. Results File Format
The results file does not have to contain all the load cases of an analysis.
For a complex analysis, there will be two data sets for each load case.The first data set contain the real solution
and the second contains the imaginary solution.
*comdeck,fdresu
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc
LONGINT resufpL
integer resubk, resuut, resuLong, resuSpare(3)
common /fdresu/ resufpL, resubk, resuut, resuLong, resuSpare
c recid tells the identifier for this record. Not all records will have
c identifiers -- they are only indicated for those records whose
c record pointers are stored in a header.
c nrec tells how many records of this description are found here
c lrec tells how long the records are (how many items are stored)
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 5
Chapter 1: Format of Binary Data Files
c 0, 0, 0, 0, 0
c --- i 1 numdof
Degrees of freedom per node
c DOF reference numbers are:
c UX = 1, UY = 2, UZ = 3, ROTX= 4, ROTY= 5, ROTZ= 6, AX = 7, AY = 8
c AZ = 9, VX =10, VY =11, VZ =12 ****** 13-18 are spares **********
c **************** PRES=19, TEMP=20, VOLT=21, MAG =22, ENKE=23, ENDS=24
c EMF =25, CURR=26, SP01=27, SP02=28, SP03=29, SP04=30, SP05=31, SP06=32
c (curdof(i),i=1,numdof)
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
6 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
1.2.3. Results File Format
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 7
Chapter 1: Format of Binary Data Files
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
8 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
1.2.3. Results File Format
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 9
Chapter 1: Format of Binary Data Files
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
10 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
1.2.3. Results File Format
c timfrq,lfacto,lfactn,cptime, tref,
c tunif, tbulk, volbase, tstep, 0.0,
c velocity-acceleration-center of gravity
c terms (positions 11-28)
c if pmeth=0: load data (positions 51-100)
c if pmeth=1: p convergence values
c (positions 31-100)
c positions 11-13
-Linear acceleration terms
c positions 14-16
- Angular velocity
c positions 17-19
- Angular acceleration
c positions 20-22
- Angular velocity about
c the center of gravity
c positions 23-25 - Angular acceleration
c about the center of
c gravity
c positions 26-28 - Center of gravity
c location
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 11
Chapter 1: Format of Binary Data Files
c if pmeth=1:
c positions 31-100 - P convergence values
c if pmeth=0:
c positions 51-100 - Load data
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
12 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
1.2.3. Results File Format
c * NSL dp 1 nnod*Sumdof The DOF solution for each node in the nodal
c coordinate system. The DOF order is the
c same as shown above in the DOF number
c reference table. The nodal order is the
c same order given above in the nodal
c equivalence table. If a DOF for a node
c isn't valid, a value of 2.0**100 is used.
c Note 1: Sumdof = numdof + nfldof.
c Note 2: If, upon reading of this record,
c there is less than nnod*Sumdof items in the
c record, then only a selected set of nodes
c were output. Another record follows
c (integer, less than nnod long) which
c contains the list of nodes for which DOF
c solutions are available.
c (bit 10 (PDBN) in mask)
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 13
Chapter 1: Format of Binary Data Files
c ptrEMS,ptrENF,ptrENS,ptrENG,ptrEGR,
c ptrEEL,ptrEPL,ptrECR,ptrETH,ptrEUL,
c ptrEFX,ptrELF,ptrEMN,ptrECD,ptrENL,
c ptrEHC,ptrEPT,ptrESF, 0,ptrETB,
c ptrECT,ptrEXY,ptrEBA,ptrESV, 0
c (Relative to ptrESL for 64 bit version)
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
14 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
1.2.3. Results File Format
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 15
Chapter 1: Format of Binary Data Files
c volume,senergy,aenergy,kenergy,coenergy,
c incenergy,0.0,0.0,thenergy,0.0,0.0
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
16 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
1.2.3. Results File Format
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 17
Chapter 1: Format of Binary Data Files
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
18 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
1.2.3. Results File Format
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 19
Chapter 1: Format of Binary Data Files
c * For 2d elements:
c * For 3d elements:
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
20 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
1.3.2. RDSP File Format
c records marked with * to the left of the record id can be read and stored
c into database with "ldread" command.
*comdeck,fdrdsp
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc
c write: lnfrcl,lnfrin,lnfrwr
c write: rdtrcl,rdtrin,rdtrwr
c read: rdtrrs,rdtrs
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 21
Chapter 1: Format of Binary Data Files
c recid tells the identifier for this record. Not all records will have
c identifiers -- they are only indicated for those records whose
c record pointers are stored in the second file header.
c nrec tells how many records of this description are found here
c lrec tells how long the records are (how many items are stored)
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
22 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
1.3.2. RDSP File Format
c --- i 1 numdof
Degrees of freedom per node
c (curdof(i),i=1,numdof)
c dof reference numbers are:
c UX = 1, UY = 2, UZ = 3, ROTX= 4, ROTY= 5, ROTZ= 6, AX = 7, AY = 8
c AZ = 9, VX =10, VY =11, VZ =12 ****** 13-18 are spares **********
c **************** PRES=19, TEMP=20, VOLT=21, MAG =22, ENKE=23, ENDS=24
c EMF =25, CURR=26 ********* 27-32 are spares *************************
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 23
Chapter 1: Format of Binary Data Files
c MAS dp nmrow nmrow Reduced mass matrix. Each row of the matrix
c is stored as a record. The matrix is present
c only if nmatrx > 1 and analysis is not using
c mode superposition method (using the subspace
c extraction technique). Row order is the same
c as the DOF order in record at ptrDOF.
c (am(i,j),i=1,nmrow)
c *** The next 2 records are repeated (as a pair) until the time value
c *** equals the value of timend. The number of iterations is stored as
c *** ncumit. (see above records that deal with time)
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
24 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
1.4.2. RFRQ File Format
c *** The next 3 records are kept for possible restart using mode superposition
c *** method. They are overwritten upon restarting. They are written once (last
c *** loadstep).
*comdeck,fdrfrq
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 25
Chapter 1: Format of Binary Data Files
c write: harmcl,harmin,harmwr
c write: hrfrcl,hrfreq
c read: harstr
c recid tells the identifier for this record. Not all records will have
c identifiers -- they are only indicated for those records whose
c record pointers are stored in the second file header.
c nrec tells how many records of this description are found here
c lrec tells how long the records are (how many items are stored)
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
26 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
1.4.2. RFRQ File Format
c used in model
c ptrDNC - pointer to nodal constraints
c ptrSTF - pointer to the reduced stiffness
c matrix
c ptrMAS - pointer to the reduced mass matrix
c ptrDMP - pointer to the reduced damping
c matrix or mode shapes
c ptrFRQ - pointer to the frequencies
c ptrDSP - pointer to the calculated
c displacements
c ptrSTFh- High part of STF pointer
c ptrMASh- High part of MAS pointer
c ptrDMPh- High part of DMP pointer
c ptrFRQh- High part of FRQ pointer
c ptrDSPh- High part of DSP pointer
c 0 - position not used
c 0 - position not used
c 0 - position not used
c 0 - position not used
c 0 - position not used
c 0 - position not used
c 0 - position not used
c 0 - position not used
c --- i 1 numdof
Degrees of freedom per node
c (curdof(i),i=1,numdof)
c dof reference numbers are:
c UX = 1, UY = 2, UZ = 3, ROTX= 4, ROTY= 5, ROTZ= 6, AX = 7, AY = 8
c AZ = 9, VX =10, VY =11, VZ =12 ****** 13-18 are spares **********
c **************** PRES=19, TEMP=20, VOLT=21, MAG =22, ENKE=23, ENDS=24
c EMF =25, CURR=26 ********* 27-32 are spares *************************
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 27
Chapter 1: Format of Binary Data Files
c MAS dp nmrow nmrow Reduced mass matrix. Each row of the matrix
c is stored as a record. The matrix is present
c only if nmatrx > 1 and analysis is not using
c mode superposition method (using the subspace
c extraction technique). Row order is the same
c as the DOF order in record at ptrDOF.
c (am(i,j),i=1,nmrow)
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
28 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
1.5.2. MODE File Format
c 4. zero zero
c 5. scale factor zero
c (zero if the
c analysis uses the
c reduced method)
c (cvs(i),i=1,nmrow),(freq,delf),
c (itime,itter),(ncumit,0.0),(0.0,0.0),
c (fscale,0.0)
c Note: If, upon reading of this record, there
c is less than nmrow+5 items in the record,
c then only a selected set of nodes were
c output. Another record follows (integer, less
c than lenbac long) which contains the list of
c nodes for which DOF solutions are available.
*comdeck,fdmode
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
c *** mpg fdmode < modspc romstr lire_freq_mode lire_nb_mode: mode file desc
character*8 MODENM
parameter (MODENM='mode ')
LONGINT modefpL, modefp
integer modebk, modeut
c recid tells the identifier for this record. Not all records will have
c identifiers -- they are only indicated for those records whose
c record pointers are stored in the second file header.
c nrec tells how many records of this description are found here
c lrec tells how long the records are (how many items are stored)
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 29
Chapter 1: Format of Binary Data Files
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
30 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
1.5.2. MODE File Format
c --- i 1 numdof
Degrees of freedom per node
c DOF reference numbers are:
c UX = 1, UY = 2, UZ = 3, ROTX= 4, ROTY= 5, ROTZ= 6, AX = 7, AY = 8
c AZ = 9, VX =10, VY =11, VZ =12 ****** 13-18 are spares **********
c **************** PRES=19, TEMP=20, VOLT=21, MAG =22, ENKE=23, ENDS=24
c EMF =25, CURR=26 ********* 27-32 are spares *************************
c (curdof(i),i=1,numdof)
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 31
Chapter 1: Format of Binary Data Files
c MAS dp nmrow nmrow Reduced mass matrix. Each row of the matrix
c is stored as a record. The matrix is present
c only if nmatrx > 1. Row order is the same as
c the DOF order stored at position ptrRDF.
c (am(i,j),i=1,nmrow)
*comdeck,fdemat
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
32 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
1.6.2. EMAT File Format
equivalence (ematfp,ematfpL)
c recid tells the identifier for this record. Not all records will have
c identifiers -- they are only indicated for those records whose
c record pointers are stored in the second file header.
c nrec tells how many records of this description are found here
c lrec tells how long the records are (how many items are stored)
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 33
Chapter 1: Format of Binary Data Files
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
34 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
1.6.2. EMAT File Format
c The records at the end of the file store element information and get written
c as a set for each element(nume sets of these records will appear on the file
c at this point) ptrEHD indicates the beginning of the element data.
c If substructure matrices are written to the EMAT file, they are written in a
c different format than is shown here. This alternate format is not documented
c at this time, as it is likely to change in the future.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 35
Chapter 1: Format of Binary Data Files
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
36 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
1.7.2. SUB File Format
*comdeck,fdsub
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc
c write: matout
c read:
c recid tells the identifier for this record. Not all records will have
c identifiers -- they are only indicated for those records whose
c record pointers are stored in the second file header.
c nrec tells how many records of this description are found here
c lrec tells how long the records are (how many items are stored)
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 37
Chapter 1: Format of Binary Data Files
c nTermL, , , ,ptrLodL,
c ,ptrMtxL, , ptrHED, name1,
c name2, , , name3, name4,
c ptrDOF, , ptrBAC, ptrTIT, ptrNOD,
c ptrXYZ, , , thsubs, ,
c , stfmax,ptrLodH, , ,
c , name5, name6, name7, name8,
c , , nTermH,ptrMtxH,ptrColL,
c ptrColH,ptrCofL,ptrCofH, 0, 0
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
38 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
1.7.2. SUB File Format
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 39
Chapter 1: Format of Binary Data Files
c DOF i 1 numdof
Degrees of freedom per node (Global)
c (curdof(i),i=1,numdof)
c DOF reference numbers are:
c UX = 1, UY = 2, UZ = 3, ROTX= 4, ROTY= 5, ROTZ= 6, AX = 7, AY = 8
c AZ = 9, VX =10, VY =11, VZ =12 ****** 13-18 are spares **********
c **************** PRES=19, TEMP=20, VOLT=21, MAG =22, ENKE=23, ENDS=24
c EMF =25, CURR=26 ********* 27-32 are spares *************************
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
40 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
1.8.2. CMS File Format
c The substructure matrices are written at this position in the file. One row
c of each matrix is written to the file at a time. i.e. the first row of each
c matrix is written, then the second row of each matrix, etc. this pattern
c continues until all nmrow rows of each matrix have been written to the file.
*comdeck,fdcms
c --- description of cms(component modal synthesis) transformation file
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 41
Chapter 1: Format of Binary Data Files
character*8 CMSNM
parameter (CMSNM='cms ')
LONGINT cmsfpL, cmsfp
integer cmsbk, cmsut
c --- See fddesc for documentation of how binary files are stored. -------------
c
c --- file format
c recid tells the identifier for this record. Not all records will have
c identifiers -- they are only indicated for those records whose
c record pointers are stored in the second file header.
c
c --- type tells what kind of information is stored in this record:
c i - integer
c dp - double precision
c cmp - complex
c
c --- nrec tells how many records of this description are found here
c
c --- lrec tells how long the records are (how many items are stored)
c
c ------------------------------------------------------------------------------
c recid type nrec lrec contents
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
42 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
1.9.2.TRI File Format
*comdeck,fdtri
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc
c
c
c ********** description of triangularized stiffness file **********
c
c *** mpg fdtri.inc < stff10 slvstr romstr modstr: tri file description
c
character*8 trinm, TriName
parameter (trinm='tri ',TriName='Tri Bufr')
LONGINT trifp
integer tribk, triut
common /fdtri/ trifp, tribk, triut
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 43
Chapter 1: Format of Binary Data Files
c
c each item in header is described below:
c
c fun11 - unit number (tri file is 11)
c nontp - number of equations on file
c nmast - number of master dofs
c 1 - position not used, always = 1
c kan - analysis type
c wfmax - maximum wavefront
c lenbac - number of nodes
c numdof - number of degrees of freedom (DOF)
c per node
c ptrMST - 32 bit pointer to the master dof
c list, only here for backward
c compatibility. Do not use if
c ptrMS1 or ptrMS2 are non-zero
c ptrend - 32 bit pointer to the end of file
c only here for backward
c compatibility. Do not use if
c ptrEN1 or ptrEN2 are non-zero
c lumpm - lumped mass key
c = 0 - default matrix type
c = 1 - lumped
c keyuns - unsymmetric key
c = 0 - the matrix is not unsymmetric
c = 1 - the matrix is unsymmetric
c ptrMS1,
c ptrMS2 - These two values are two halves of
c a 64 bit pointer that points to the
c master dof list
c ptrEN1,
c ptrEN2 - These two values are two halves of
c a 64 bit pointer that points to the
c end of file
c 0 - position not used
c 0 - position not used
c ptrTRI - pointer to the beginning of the
c triangularized matrix data
c 0 - position not used
c
c --- i 1 numdof
Degrees of freedom per node
c DOF reference numbers are:
c UX = 1, UY = 2, UZ = 3, ROTX= 4, ROTY= 5, ROTZ= 6, AX = 7, AY = 8
c AZ = 9, VX =10, VY =11, VZ =12 ****** 13-18 are spares **********
c **************** PRES=19, TEMP=20, VOLT=21, MAG =22, ENKE=23, ENDS=24
c EMF =25, CURR=26 ********* 27-32 are spares *************************
c (curdof(i),i=1,numdof)
c
c --- i 1 lenbac Nodal equivalence table. This table equates
c the number used for storage to the actual
c node number
c (Back(i),i=1,lenbac)
c
c TRI At this point in the file, the triangularized matrix information is
c stored. The info is written row by row, and there are two different
c storage options for writing a row. If the row being written does not
c have a constraint equation associated with it, then two records are
c written to describe the row. If the row being written has a constraint
c equation associated with it, then five records are written to describe
c the row. Both formats are shown below. These groupings of two or five
c records per row will be written a total of nontp times (to include all
c rows)
c
c The next two descriptions show the format for a row that does not have a
c constraint equation associated with it:
c
c --- dp/cmp 1 varies A row of the triangularized matrix.
c
c If keyuns=0, this record will contain the
c non-diagonal terms of this column, the
c diagonal term itself, the normalized F
c term, followed by the reciprocal of the row
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
44 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
1.9.2.TRI File Format
c pivot.
c
c If keyuns=1, this record will contain the
c non-diagonal terms of this column, the
c diagonal term itself, the normalized F
c term, the reciprocal of the row pivot,
c followed by the non-diagonal terms of this
c row.
c
c The length of this record will vary (actual
c length is returned from routine BINRD8). If
c kan=3, this record contains complex
c information, otherwise it contains double
c precision information.
c (ktri(i),i=1,n),vload,diag (symmetric)
c (ktri(i),i=1,n),vload,diag,(utri(i),i=1,n)
c (unsymmetric)
c
c --- i 1 varies Triangular matrix row indices. The first
c item signifies what term in the row belongs
c to the pivot. The second term signifies what
c DOF is being eliminated, and the remaining
c items signify the new DOFs being introduced
c (if any). The length of this record will
c vary (actual length is returned from routine
c BINRD8).
c (lll(i),i=1,m)
c
c The next five descriptions show the format for a row that has a constraint
c equation associated with it.
c
c --- dp 1 2 A flag record, indicating that constraint
c equations are being stored, and the storage
c is as shown here. Both values are TINY.
c
c --- dp 1 varies Coefficients of the constraint equation.
c The length of this record will vary (actual
c length is returned from routine BINRD8).
c (coeff(i),i=1,n+2)
c
c --- dp/cmp 1 varies A row of the triangularized matrix.
c
c If keyuns=0, this record will contain the
c non-diagonal terms of this column, the
c diagonal term itself, the normalized F
c term, followed by the reciprocal of the row
c pivot.
c
c If keyuns=1, this record will contain the
c non-diagonal terms of this column, the
c diagonal term itself, the normalized F
c term, the reciprocal of the row pivot,
c followed by the non-diagonal terms of this
c row.
c
c The length of this record will vary (actual
c length is returned from routine BINRD8). If
c kan=3, this record contains complex
c information, otherwise it contains double
c precision information.
c (ktri(i),i=1,n),vload,diag (symmetric)
c (ktri(i),i=1,n),vload,diag,(utri(i),i=1,n)
c (unsymmetric)
c
c --- i 1 varies Triangular matrix row indices. The first
c item signifies what term in the row belongs
c to the pivot. The second term signifies what
c DOF is being eliminated, and the remaining
c items signify the new DOFs being introduced
c (if any). The length of this record will
c vary (actual length is returned from routine
c BINRD8).
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 45
Chapter 1: Format of Binary Data Files
c (lll(i),i=1,m)
c
c --- i 1 2 This record indicates the end of the 5
c record storage for this row. It is included
c for situations when the file is being read
c from the bottom up. Its contents:
c
c -cenum, n
c
c cenum - the constraint equation number for
c the constraint equation stored
c above
c n - the length of a row of the matrix
c being written
c
c MST i 1 nmast This record is present only if nmast > 0.
c or This index is calculated as
c MS1, (N-1)*NUMDOF+DOF, where N is the position
c MS2 number of the node in the nodal equivalence
c table, and DOF is the DOF reference number
c given above
*comdeck,fdfull
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
character*8 FULLNM
parameter (FULLNM='full ')
c recid tells the identifier for this record. Not all records will have
c identifiers -- they are only indicated for those records whose
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
46 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
1.10.2. FULL File Format
c nrec tells how many records of this description are found here
c lrec tells how long the records are (how many items are stored)
c NOTE: If fun04 > 0, then the file was created with frontal assembly
c If fun04 < 0, then the file was created with symbolic assembly;see below
c for its format
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 47
Chapter 1: Format of Binary Data Files
c --- i 1 numdof
Degrees of freedom per node
c DOF reference numbers are:
c UX = 1, UY = 2, UZ = 3, ROTX= 4, ROTY= 5, ROTZ= 6, AX = 7, AY = 8
c AZ = 9, VX =10, VY =11, VZ =12 ****** 13-18 are spares **********
c **************** PRES=19, TEMP=20, VOLT=21, MAG =22, ENKE=23, ENDS=24
c EMF =25, CURR=26 ********* 27-32 are spares *************************
c (curdof(i),i=1,numdof)
c NOTE: The next five records are repeated as a group neqn times.
c When the matrices get written, one row of each matrix is written to the file
c at a time. i.e. the first row of each matrix is written, then the second row
c of each matrix, etc. this pattern continues until all the rows of each
c matrix have been written to the file. If kan=3, the matrix rows will be
c complex valued, otherwise they will be double precision values.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
48 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
1.10.2. FULL File Format
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 49
Chapter 1: Format of Binary Data Files
c --- i 1 numdof
Degrees of freedom per node
c DOF reference numbers are:
c UX = 1, UY = 2, UZ = 3, ROTX= 4, ROTY= 5, ROTZ= 6, AX = 7, AY = 8
c AZ = 9, VX =10, VY =11, VZ =12 ****** 13-18 are spares **********
c **************** PRES=19, TEMP=20, VOLT=21, MAG =22, ENKE=23, ENDS=24
c EMF =25, CURR=26 ********* 27-32 are spares *************************
c Stiffness Matrix. The next two records are repeated as a group neqn times.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
50 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
1.10.2. FULL File Format
c DOF information
c Mass Matrix.
c if lumpm = 0:
c The next two records are repeated as a group neqn times.
c if lumpm = 1:
c --- dp 1 neqn Matrix diagonals
c Damping Matrix. The next two records are repeated as a group neqn times.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 51
Chapter 1: Format of Binary Data Files
c This results in
c [K*]{x2} = {F*}
c where
c [K*] = [G]'[K11][G] + [G]'[K12] + [K21][G] + [K22]
c {F*} = [G]'{f1} + {f2} - [G]'[K11]{g} - [K21]{g}
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
52 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 2: Accessing Binary Data Files
2.1. Accessing ANSYS Binary Files
The following section explains the routines you need to read, write, or modify an ANSYS binary file.This collection
of routines (called BINLIB) resides on your ANSYS distribution media.The BINLIB library is in the dynamic link
library \Program Files\Ansys Inc\V110\ANSYS\custom\misc\<platform>\binlib.dll (on
Windows systems (where <platform> is a directory that uniquely identifies the hardware platform version))
or the shared library /ansys_inc/v110/ansys/customize/misc/<platform>/libbin.so on UNIX
systems (libbin.sl on HP systems).
Your distribution media also includes sample FORTRAN source files which employ the BINLIB library:
bintrd.F The bintrd subroutine reads and prints the contents of an ANSYS binary file
bintwr.F The bintwr subroutine copies an ANSYS binary file to a new file
bintst.F The bintst program calls the bintwr and bintrd subroutines as an example of
how to use the binlib library to print the contents of a file, copy the original file
to a new file, and then print the contents of the new file. Routine bintst has no
inputs or outputs. It requires use of the bintcm common. (For more information,
see the descriptions of the bintrd and bintwr routines later in this chapter.)
ResRdDemo
ResWrDemo
rdsubs
wrtsub
rdfull
On Windows systems:
The FORTRAN source for these programs is located in \Program Files\Ansys Inc\V110\ANSYS\cus-
tom\misc and the files are named ResRdDemo.F, ResWrDemo.F, rdsubs.F, wrtsub.F, and rdfull.F.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 53
Chapter 2: Accessing Binary Data Files
Use the userprog command line option when writing your own customized program, naming the routine
userprog.F.The resulting executable will be named userprog.exe. When userprog is used, no files are
copied from \Program Files\Ansys Inc\V110\ANSYS\custom\misc\<platform> to your working
directory.
These files will be loaded onto your system only if you performed a custom installation and chose to install the
customization tools.
On UNIX systems:
The FORTRAN source for these programs is located in /ansys_inc/v110/ansys/custom/misc and the
files are named ResRdDemo.F, ResWrDemo.F, rdsubs.F, wrtsub.F, and rdfull.F.
Use the userprog command line option when writing your own customized program, naming the routine
userprog.F.The resulting executable will be named userprog.e110. When userprog is used, no files
are copied from /ansys_inc/v110/ansys/customize/misc to your working directory.The procedure
file is named userprog110.
These files will be loaded onto your system only if you performed a custom installation and chose to install the
customization tools.
1. An ANSYS binary file is a direct access, unformatted file.You read or write a record by specifying (as a
number) what location to read or write.
2. Before the ANSYS program actually writes data to a file on a disk, it uses buffers to store data in memory
until those buffers become full. A block number designates these buffers. Most access routines use this
block number.
3. By default, ANSYS files are external files.The standardized "external" format the files use enables you to
transport them across different computer systems.
4. In addition to file names, ANSYS uses file numbers to identify the files. File handles and other information
are associated with the file numbers.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
54 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
2.1.6. Function sysiqr (Retrieving the Status of a File)
5. Some binary files contain data values that point to the start of certain data (for example, the start of the
data steps index table record). Both the ANSYS program and external binary files access routines use
these pointers to locate data on the various binary files.
6. All data is written out as 32-bit integers. Double-precision data and pointers, therefore, take up two integer
words.To create a 64-bit pointer from the two 32-bit integers, use the function largeIntGet.
AUX2 does not use the data pointers discussed in item 5 above. It uses record numbers to locate the binary file
data to dump. Although the information that AUX2 provides includes the pointer, using the pointer alone will
not get you that information.To get it, you must correlate the pointer and the record number by trial and error.
2.1.4. Abbreviations
The input and output for the routines discussed in this chapter are described with the following abbreviations:
int - integer
dp - double-precision
log - logical (true or false)
char - character
Size of variable is one of the following:
sc - scalar variable
ar(n) - array of size n
Intent of variable is one of the following:
in - input only
out - output only
inout - both an input and an output variable
*deck,binini
subroutine binini (iott)
c *** primary function: initialize buffered binary i/o system
c --- This routine is intended to be used in standalone programs.
c --- This routine should not be linked into the ANSYS program.
c input arguments:
c iott (int,sc,in) - output unit number for error output
*deck,sysiqr
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 55
Chapter 2: Accessing Binary Data Files
c input arguments:
c variable (typ,siz,intent) description
c nunit (int,sc,in) - fortran unit number (used only for inqr='O')
c fname (chr,sc,in) - name of file
c lname_in (int,sc,in) - length of file name (characters, max=50)
c inqr_in (chr,sc,in) - character key for information requested
c = 'E' - return whether file exists
c sysiqr = 1 - file exists
c = 0 - file does not exist
c < 0 - error occured
c = 'O' - return whether file is open
c sysiqr = 1 - file is open
c = 0 - file is closed
c < 0 - error occured
c = 'N' - return unit number of file
c sysiqr > 0 - unit number for file
c = 0 - file not assigned to a unit
c < 0 - error occured
c output arguments:
c sysiqr (int,func,out) - the returned value of sysiqr is based on
c setting of inqr
*deck,biniqr8
function biniqr8 (nblk,key)
c *** primary function: get data about a block i/o buffer
c --- This routine is intended to be used in standalone programs.
c --- This routine should not be linked into the ANSYS program.
c input arguments:
c nblk (int,sc,in) - the block number for the inquiry
c or zero (see below)
c key (int,sc,in) - key for information requested
c nblk = 0 - return information about system/file
c key = 1 - return system block size
c = 2 - return number of integers per dp
c = 3 - return filename length
c 5 = return integers per LONG
c nblk > 0 - return information about this block
c key = 1 - return fortran unit number
c = 2 - return number of blocks in file
c = 3 - return length of page (32 bit words)
c = 4 - return open status
c 0 - file close
c 1 - file open
c = 5 - return file format
c 0 - internal format
c 1 - external format
c = 6 - return read/write status
c 0 - both read & write
c 1 - read
c 2 - write
c = 7 - return current position on file
c = 8 - return maximum length of file
c (in words)
c = 9 - return starting word for this page
c in buffer
c output arguments:
c biniqr (int,func,out) - the returned value of biniqr is based on
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
56 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
2.1.9. Subroutine bintfo (Defining Data for a Standard ANSYS File Header)
2.1.8. Function binset (Opening a Blocked Binary File or Initializing Paging Space)
*deck,binset
function binset (nblk,nunit,ikeyrw,istart,paglen,npage,
x pname,nchar,kext,Buffer4)
c *** primary function: initialize paging space for a blocked binary file.
c binset should be used to open a blocked file
c before binrd8 or binwrt8 are used. binclo should
c be used to close the file.
c --- This routine is intended to be used in standalone programs.
c --- This routine should not be linked into the ANSYS program.
c input arguments:
c nblk (int,sc,in) - block number (1 to BIO_MAXFILES max)
c nunit (int,sc,in) - fortran unit number for the file
c (if 0, bit bucket)
c ikeyrw (int,sc,in) - read/write flag
c = 0 - both read & write
c = 1 - read
c = 2 - write
c = 9 - read only
c istart (int,sc,in) - starting location in buffer array
c usually 1 for nblk=1, paglen*npage+1
c for nblk=2,etc.
c paglen (int,sc,in) - page length in integer*4 words for external
c files
c paglen should always be a multiple of
c 512 words for efficiency
c npage (int,sc,in) - number of pages (1 to BIO_MAXBLOCKS max)
c pname (chr,ar(*),in) - name of the file
c nchar (int,sc,in) - number of characters in the file name(not
c used)
c kext (int,sc,in) - no longer used, always external format
c Buffer4 (i4, ar(*),inout) - work array for paging, should be
c dimensioned to paglen*npage*nblk (max)
c output arguments:
c binset (int,func,out) - error status
c = 0 - no error
c <>0 - error occurred
c Buffer4 (i4, ar(*),inout) - work array for paging
2.1.9. Subroutine bintfo (Defining Data for a Standard ANSYS File Header)
*deck,bintfo
subroutine bintfo (title,jobnam,units,code)
c *** primary function: set information necessary for binhed
c --- This routine is intended to be used in standalone programs.
c --- This routine should not be linked into the ANSYS program.
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c typ=int,dp,log,chr,dcp siz=sc,ar(n) intent=in,out,inout
c
c input arguments:
c variable (typ,siz,intent) description
c title (chr*80,ar(2),in) - main title and 1st subtitle
c jobnam (chr*8,sc,in) - jobname
c units (int,sc,in) - units
c = 0 - user defined units
c = 1 - SI (MKS)
c = 2 - CSG
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 57
Chapter 2: Accessing Binary Data Files
*deck,binhed
subroutine binhed (nblk,nunit,filpos,buffer)
c *** primary function: put standard header on a binary file, all
c permanent binary files should have this header
c *** secondary functions: return the first data position
c --- This routine is intended to be used in standalone programs.
c --- This routine should not be linked into the ANSYS program.
c input arguments:
c nblk (int,sc,in) - block number of open binary file
c (as defined with subroutine binset)
c nunit (int,sc,in) - the unit number for this file
c buffer (int,ar(*),inout) - work array for paging, should be the
c same array as used in binset
c output arguments:
c filpos (int,sc,out) - the position after the header
c buffer (int,ar(*),inout) - work array for paging
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
58 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
2.1.12. Subroutine binwrt8 (Writing Data to a Buffered File)
*deck,binrd8
subroutine binrd8 (nblk,LongLocL,leng,ivect,kbfint,Buffer4)
c input arguments:
c nblk (int,sc,in) - block number. see fd___(i.e. fdtri for tri
c
c (as defined with subroutine bioset)
c LongLocL(LONG,sc,inout)- location in integer*4 words of the startin
c position on the file.
c leng (int,sc,inout) - number of words to read into ivect. (must be
c less or equal to dimension given to ivect in
c the calling routine). if ivect is to be used
c as integers, use as is. if ivect is to be
c used for double precision numbers, it must be
c increased by multiplying it by INTPDP.
c if negative, skip record and do not return
c data(results).
c data(results).
c Buffer4 (i4, ar(*),inout) - work array for paging, should be the
c same array as used in binset
c output arguments:
c LongLocL(LONG,sc,inout)- location in integer*4 words of the current
c position on the file. It is updated after
c each read operation
c leng (int,sc,inout) - tells you how many items it actually read(in
c integer words).
c if zero, end of file(error case)
c ivect (int,ar(*),out) - results (can be either integer or double
c precision in the calling routine)
c kbfint (int,sc,out) - key for type(used only for AUX2 dump)
c = 0 double precision data
c > 0 integer data(usually the same as leng)
c Buffer4 (i4,ar(*),inout) - work array for paging
Versions of binrd8/binwrt8 exist without the "8" suffix (binrd/binwrt) that take a regular integer for the
second argument.These subroutines, therefore, cannot address large files where the file position exceeds 2**31.
Use the binrd8/binwrt8 versions for any new programs.
*deck,binwrt8
subroutine binwrt8 (nblk,LongLocL,leng,ivect,kbfint,Buffer4)
c *** primary function: buffer write routine
c --- This routine is intended to be used in standalone programs.
c --- This routine should not be linked into the ANSYS program.
c input arguments:
c nblk (int,sc,in) - block number. see fd___(i.e. fdtri for tri
c
c LongLocL(LONG,sc,inout)- location in integer words of the starting
c position on the file.
c leng (int,sc,in) - number of words to read from ivect. (must be
c less or equal to dimension given to ivect in
c the calling routine). if ivect is to be used
c as integers, use as is. if ivect is to be
c used for double precision numbers, it must be
c increased by multiplying it by INTPDP.
c ivect (int,ar(*),in) - data to be written onto the file(can be either
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 59
Chapter 2: Accessing Binary Data Files
c output arguments:
c LongLocL(LONG,sc,inout)- location in integer words of the current
c position on the file. It is updated after
c each write operation
c ivect (int,ar(*),out)- vector containing record to be written
c Buffer4 (int,ar(*),inout) - work array for paging
Versions of binrd8/binwrt8 exist without the "8" suffix (binrd/binwrt) that take a regular integer for the
second argument.These subroutines, therefore, cannot address large files where the file position exceeds 2**31.
Use the binrd8/binwrt8 versions for any new programs.
*deck,exinc4
subroutine exinc4 (ichext,chin,n)
c primary function: decode externally formatted integer versions of 4-character
c strings to plain 4-character strings (used to convert data
c from externally formatted files to data for interally
c formatted files)
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c input arguments:
c ichext (int,ar(n),in) - externally formatted integer form of
c 4-character strings
c n (int,sc,in) - number of strings to convert
c
c output arguments:
c chin (char,ar(n),out) - strings in character form
c
*deck,inexc4
subroutine inexc4 (chin,ichext,n)
c primary function: encode plain 4-character strings into externally formatted
c integer versions of 4-character strings (used to convert
c data from internally formatted files to data for
c externally formatted files)
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c input arguments:
c chin (char,ar(n),in) - strings in character form
c n (int,sc,in) - number of strings to convert
c
c output arguments:
c ichext (int,ar(n),out) - externally formatted integer form of
c 4-character strings
c
*deck,binclo
subroutine binclo (nblk,pstat,Buffer4)
c *** primary function: close a blocked file, every block/file opened with
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
60 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
2.2.1. Program bintst (Demonstrates Dumping a Binary File and Copying It for Comparison Purposes)
c input arguments:
c nblk (int,sc,in) - the block number to close
c (as defined with subroutine binset)
c pstat (chr,sc,in) - keep or delete flag
c = 'K' - keep file
c = 'D' - delete file
c Buffer4 (int,ar(*),inout) - work array for paging, should be the
c same array as used in binset
c output arguments:
c Buffer4 (int,ar(*),inout) - work array for paging
*deck,largeIntGet
function largeIntGet (small,large)
c object/library: res
c input arguments:
c small (int,sc,in) - least significant part
c large (int,sc,in) - most significant part
c output arguments:
c largeIntGet (LONGINT,sc,out) - 64 bit integer
2.2.1. Program bintst (Demonstrates Dumping a Binary File and Copying It for Comparison
Purposes)
The bintst program dumps a binary file with the name file.rst to the screen. It then takes that file, copies
it to a new file, file2.rst, and dumps the new file to the screen for comparison purposes.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 61
Chapter 2: Accessing Binary Data Files
Note
The bintst program is not part of the binlib.a library. It is included here only to aid you.
*deck,bintrd
subroutine bintrd (pname)
c *** primary function: bin file dump utility
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c *** ansys(r) copyright(c) 2000
c *** ansys, inc.
c
c typ=int,dp,log,chr,dcp siz=sc,ar(n) intent=in,out,inout
c
c input arguments:
c variable (typ,siz,intent) description
c pname (chr,sc,in) - name of binary file which is to
c be dumped to the screen
c
c output arguments:
c none.
c
c common variables:
c iout (int,sc,comm) - output unit number
c intpdp (int,sc,comm) - number of integers per double precision word
c lenfnm (int,sc,comm) - number of characters in the filename
c reclng (int,sc,comm) - system record length
c
c NOTE: bintrd is not part of binlib.a. it is
c included only as an aid to users.
c
Note
The bintrd routine and the bintwr routine described below are not part of binlib.a.This
chapter includes it only to aid you.You can find the source for this routine on the ANSYS distribution
media.
*deck,bintwr
subroutine bintwr (pname,nname)
c *** primary function: bin file copy utility
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c *** ansys(r) copyright(c) 2000
c *** ansys, inc.
c
c typ=int,dp,log,chr,dcp siz=sc,ar(n) intent=in,out,inout
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
62 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
2.2.6. Program rdfull (Demonstrates Reading and Reformatting the .FULL File)
c
c input arguments:
c variable (typ,siz,intent) description
c pname (chr,sc,in) - name of binary file which is to be copied
c
c output arguments:
c variable (typ,siz,intent) description
c nname (chr,sc,out) - name of new binary file which is a copy
c of pname
c common variables:
c iout (int,sc,comm) - output unit number
c intpdp (int,sc,comm) - number of integers per double precision word
c lenfnm (int,sc,comm) - number of characters in the filename
c reclng (int,sc,comm) - system record length
c
c NOTE: bintwr is not part of binlib.a. it is
c included only as an aid to users.
c
*deck,wrtsub
program wrtsub
*deck,rdsubs
program rdsubs
c primary function: demonstrates use of binary access routines
c secondary function: read an ANSYS substructure file
2.2.6. Program rdfull (Demonstrates Reading and Reformatting the .FULL File)
Program rdfull demonstrates how to read and reformat the .FULL file. ANSYS writes the full file if the
PSOLVE,ELFORM, PSOLVE,ELPREP, PSOLVE,TRIANG sequence is used.You can also use the WRFULL command.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 63
Chapter 2: Accessing Binary Data Files
If you want to use the free stiffness and mass matrices, make sure that there are no constraints on your model.
*deck,rdfull
program rdfull
c *** primary function: demonstrates use of binary access routines
c *** secondary function: Read and reformat full file
c
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
c
c NOTICE - A new assembly process, termed 'symbolic assembly', has
c replaced the old assembly process, termed 'frontal
c assembly', and is now the default assembly process for
c most analyses. This program demonstrates how to read
c and reformat the .FULL file that was created using
c frontal assembly or symbolic assembly. ANSYS writes the
c .FULL file if the PSOLVE,ELFORM
c PSOLVE,ELPREP
c PSOLVE,TRIANG
c sequence is used. ANSYS will also write the .FULL file
c when the sparse, ICCG, or JCG solver is used, as well as
c when most mode extraction methods are used.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
64 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
2.3.2. ResRdBegin (Opening the File and Retrieving Global Information)
Read the record index and allocate space for the data.These are named ResRdrecordBegin, where
record is a descriptive name of the record, e.g., ResRdNodeBegin
Read the data itself.These are named ResRdrecord, e.g., ResRdNode
Deallocate space for the data.These are named ResRdrecordEnd, e.g., ResRdNodeEnd
Below is a complete listing of all the routines with the indentation indicating the required nested calling sequence:
function ResRdBegin (Nunit,Lunit,Fname,ncFname,Title,JobName,
subroutine ResRdGeomBegin (MaxType,MaxReal,MaxCsys)
subroutine ResRdTypeBegin (NumType)
function ResRdType (itype,ielc)
subroutine ResRdTypeEnd
subroutine ResRdRealBegin (NumReal,NumPerReal)
function ResRdReal (iReal,Rcon)
subroutine ResRdRealEnd
subroutine ResRdCsysBegin (NumCsys)
function ResRdCsys (iCsys,Csys)
subroutine ResRdCsysEnd
subroutine ResRdNodeBegin
function ResRdNode (iNode,xyzang)
subroutine ResRdNodeEnd
subroutine ResRdElemBegin
function ResRdElem (iElem,nodes,ElemData)
subroutine ResRdElemEnd
subroutine ResRdGeomEnd
function ResRdSolBegin (key,lstep,substep,ncumit,kcmplx,time,
subroutine ResRdDispBegin
function ResRdDisp (node,Disp)
subroutine ResRdDispEnd
subroutine ResRdRforBegin (nRForce)
function ResRdRfor (node,idof,value)
subroutine ResRdRforEnd
subroutine ResRdBCBegin (BCHeader)
subroutine ResRdFixBegin (BCHeader,nFixed)
function ResRdFix (node,idof,value)
subroutine ResRdFixEnd
subroutine ResRdForcBegin (BCHeader,nForces)
function ResRdForc (node,idof,value)
subroutine ResRdForcEnd
subroutine ResRdBCEnd
subroutine ResRdEresBegin
function ResRdEstrBegin (iElem)
function ResRdEstr (iStr,Str)
subroutine ResRdEstrEnd
subroutine ResRdEresEnd
subroutine ResRdSolEnd
subroutine ResRdEnd
These routines are contained in the file ResRd.F. See the demonstration routine ResRdDemo.F on the distri-
bution medium for an example of the usage of these routines.
The memory allocation scheme is described in Memory Management Routines in the Guide to ANSYS User Pro-
grammable Features.
The following sections describe the data-reading routines. See the file ResRd.F and its corresponding include
deck ResRd.inc for listings of the corresponding Begin/End routines.
*deck,ResRdBegin
function ResRdBegin (Nunit, Lunit, Fname, ncFname, Title, JobName,
x Units, NumDOF, DOF, UserCode,
x MaxNode, NumNode, MaxElem, NumElem,
x MaxResultSet,NumResultSet)
c primary function: Open result file and return global information
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 65
Chapter 2: Accessing Binary Data Files
c object/library: ResRd
c input arguments:
c Nunit (int,sc,in) - Fortran Unit number for file (ANSYS uses 12)
c Lunit (int,sc,in) - Current print output unit (usually 6 <STDOUT>)
c Fname (ch*(ncFname),sc,in) - The name (with extension) for the file
c ncFname (int,sc,in) - Number of characters in Fname
c output arguments:
c Title (ch*80,ar(2),out) - Title and First subtitle
c JobName (ch*8,sc,out) - Jobname from file
c Units (int,sc,out) - 0, unknown 1, SI 2, CSG
c 3, U.S. Customary - foot
c 4, U.S. Customary - inch
c 6, MPA
c NumDOF (int,sc,out) - Number of DOF per node
c DOF (int,ar(*),out) - The DOFs per node
c UserCode (int,sc,out) - Code for this application
c MaxNode (int,sc,out) - Maximum node number used
c NumNode (int,sc,out) - Number of nodes used
c MaxElem (int,sc,out) - Maximum element number used
c NumElem (int,sc,out) - Number of elements used
c MaxResultSet (int,sc,out) - Maximum number of result sets (usually 1000)
c NumResultSet (int,sc,out) - Number of result sets on file
c ResRdBegin (int,sc,out) - 0, successful other, error in file open
*deck,ResRdGeomBegin
subroutine ResRdGeomBegin (MaxType, MaxReal, MaxCsys)
c primary function: Read Geometry Header Record
c object/library: ResRd
c output arguments:
c MaxType (int,sc,out) - Maximum element type
c MaxReal (int,sc,out) - Maximum real constant set number
c MaxCsys (int,sc,out) - Maximum coordinate system number
*deck,ResRdType
function ResRdType (itype,ielc)
c primary function: Read an element type record
c object/library: ResRd
c input arguments:
c itype (int,sc,on) - Element type number
*deck,ResRdReal
function ResRdReal (iReal,Rcon)
c primary function: Read real constant record
c object/library: ResRd
c input arguments:
c iReal (int,sc,in) - Real set number
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
66 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
2.3.8. ResRdElem (Retrieving Elements)
*deck,ResRdCsys
function ResRdCsys (iCsys,Csys)
c primary function: Read a coordinate system record
c object/library: ResRd
c input arguments:
c iCsys (int,sc,in) - Coordinate system number
c output arguments:
c Csys (dp,ar(ResRdCsys),out)- Coordinate system description
c ResRdCsys (int,sc,out) - Number of values
c output arguments:
*deck,ResRdNode
function ResRdNode (iNode,xyzang)
c primary function: Get a node
c object/library: ResRd
c input arguments:
c iNode (int,sc,in) - node sequence number
c (1 to NumNode)
c output arguments:
c xyzang (dp,ar(6),out) - x,y,z,thxy,thyz,thzx for node
c ResRdNode (int,sc,out) - Node number
*deck,ResRdElem
function ResRdElem (iElem, nodes, ElemData)
c primary function: Read an element
c object/library: ResRd
c input arguments:
c iElem (int,sc,in) - The element number
c output arguments:
c ResRdElem(int,sc,out) - Number of nodes
c nodes (int,ar(n),out) - Element nodes
c ElemData (int,ar(10),out) - Element information
c mat - material reference number
c type - element type number
c real - real constant reference number
c secnum - section number
c esys - element coordinate system
c death - death flag
c = 0 - alive
c = 1 - dead
c solidm - solid model reference
c shape - coded shape key
c elnum - element number
c pexcl - P-Method exclude key
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 67
Chapter 2: Accessing Binary Data Files
*deck,ResRdSolBegin
function ResRdSolBegin (key,lstep,substep,ncumit,kcmplx,time,
x Title,DofLab)
c primary function: Read the solution header records
c object/library: ResRd
c input arguments:
c key (int,sc,in) - 1, find by lstep/substep
c 2, find by ncumit
c 3, find by time
c lstep (int,sc,in/out) - Load step number
c substep (int,sc,in/out) - Substep of this load step
c ncumit (int,sc,in/out) - Cumulative iteration number
c kcmplx (int,sc,in) - 0, Real solution 1, Imaginary solution
c time (int,sc,in/out) - Current solution time
c output arguments:
c Title (ch*80,ar(5),out) - Title and 4 subtitles
c DofLab (ch*4,ar(nDOF),out)- Labels for DOFs
c ResRdSolBegin (int,sc,out) - 0, requested solution set found
c 1, not found
*deck,ResRdDisp
function ResRdDisp (node,Disp)
c primary function: Retrieve a nodal displacement
c object/library: ResRd
c input arguments:
c node (int,sc,in) - Node number
*deck,ResRdRfor
function ResRdRfor (node,idof,value)
c primary function: Retrieve a reaction force
c object/library: ResRd
c input arguments:
c node (int,sc,in) - External node number
c idof (int,sc,in) - Internal dof number
c output arguments:
c value (dp,sc,in) - Value of reaction force
c ResRdRfor (int,sc,out) - Number of returned values (0 or 1)
*deck,ResRdFix
function ResRdFix (node,idof,value)
c primary function: Retrieve a constraint value
c object/library: ResRd
c input arguments:
c node (int,sc,in) - External node number
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
68 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
2.3.14. ResRdEstr (Retrieving Element Solutions)
c output arguments:
c value (dp,ar(4),in) - Real,Imag, RealOld,ImagOld
c ResRdFix (int,sc,out) - Number of returned values (0 or 4)
*deck,ResRdForc
function ResRdForc (node,idof,value)
c primary function: Retrieve an applied force value
c object/library: ResRd
c input arguments:
c node (int,sc,in) - External node number
c idof (int,sc,in) - Internal dof number
c output arguments:
c value (dp,ar(4),in) - Real,Imag, RealOld,ImagOld
c ResRdForc (int,sc,out - Number of returned values (0 or 4)
*deck,ResRdEstr
function ResRdEstr (iStr,Str)
c primary function: Get an element's results
c object/library: ResRd
c input arguments:
c iStr (int,sc,in) - element record number (1-25)
c output arguments:
c ResRdEstr (int,sc,out) - Number of element values
c Str (dp,ar(nStr),out) - element values
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 69
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
70 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 3: Using CDREAD and CDWRITE
3.1. Using the CDREAD Command
The CDREAD command and its GUI equivalent, Main Menu> Preprocessor> Archive Model> Read, read a file
of model and database information into the ANSYS database.The commands and menu paths listed below
define the input data that the ANSYS program requires to solve a model. If the file you are reading into the
database via CDREAD or Main Menu> Preprocessor> Archive Model> Read does not contain all of the required
input data, you can use these commands or menu paths to define that data in the preprocessor. For detailed
information about the commands, see the Commands Reference.
In the following list, commands or menu paths shown with an asterisk (*) are the minimum requirements for a
solution.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 71
Chapter 3: Using CDREAD and CDWRITE
If you place the command /NOPR at the beginning of the file and /GOPR at the end of the file, you can
suppress printing of the file and speed up the time to read it.
Use the /COM command to add comments to the file. If the file contains the /NOPR command, /COM
provides status information about what is being read in. For example:
/COM, READING NODES
N,1,.....
,
,
Group elements with the same attributes (TYPE, REAL, MAT, ESYS). Do not use a separate MAT, REAL,
TYPE, and ESYS command for each element.
Use Utility Menu> File> Change Title or the /TITLE command to add a title to graphics displays and
printouts.
Use Utility Menu> File> Read Input From or the /INPUT command at the Begin level to input the file.
The Jobname.cdb file contains selected geometry (nodes and elements), load items, and other model data in
terms of ANSYS input commands. (For a complete list of data in the file, see the CDWRITE description in the
Commands Reference.) You can convert this information to a format compatible with the program into which
you are importing it.The next few pages describe special considerations and commands you may need to do
this conversion.
Note
Files created by the CDWRITE command have the active coordinate system set to Cartesian (CSYS,
0).
ANSYS may create parameters in the CDWRITE file that start with an underscore (_), usually an _z.
Such parameters are for ANSYS internal use and pass information to the ANSYS GUI.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
72 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
3.2.1. Customizing Degree of Freedom Labels: the /DFLAB Command
You can change the labels to reflect the degrees of freedom of the other program by issuing the command
/DFLAB. If you are customizing the DOF labels, /DFLAB must be the first command you enter within the ANSYS
program.You may want to include the command in your START.ANSfile.You can use /DFLAB only at the Begin
processing level.
/DFLAB assigns or reassigns the "displacement" and "force" labels in the ANSYS DOF list. For example, degree
of number 1 is predefined to have a displacement label of UX and a force label of FX, but you can assign new
labels to this DOF using by issuing /DFLAB. Changing predefined labels generates a warning message.
NDOF
ANSYS degree of freedom number (1 to 32)
LabD
Displacement degree of freedom label to be assigned (up to four characters)
LabF
Force label to be assigned (up to four characters)
You can also use /DFLAB to assign labels to spare degree of freedom numbers. Spare displacement and force
labels are from 13 to 18 and from 27 to 32. All other DOF numbers are predefined, as follows:
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 73
Chapter 3: Using CDREAD and CDWRITE
The CDWRITE command has an UNBLOCKED and a BLOCKED option.The UNBLOCKED option will write all data
out in command format. the default BLOCKED option will write certain data items in a fixed format, especially
those which could potentially contain large amounts of data, such as nodal data.
3.3.1. CE Command
The CE command defines the constant term in a constraint equation.The command format in Jobname.CDB
is:
CE,R5.0,Type,LENGTH,NCE,CONST
Type
The type of data to be defined. DEFI is the valid label.
LENGTH
The total number of variable terms in the constraint equation.
NCE
The constraint equation reference number.
CONST
The constant term of the equation.
Another version of the CE command defines the variable terms in a constraint equation.You must issue this
version of the command after the CE command described above.This command repeats until all terms are
defined.
Type
The type of data to be defined. NODE is the valid label.
N1
The node number of the next term.
Dlab1
The DOF label of N1.
C1
The coefficient of N1.
N2
The node number of the next term.
Dlab2
The DOF label of N2.
C2
The coefficient of N2.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
74 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
3.3.4. EBLOCK Command
3.3.2. CP Command
The CP command defines a coupled node set.You repeat the command until all nodes are defined.The command
format in Jobname.CDB is:
CP,R5.0,LENGTH,NCP,Dlab,N1,N2,N3,N4,N5,N6,N7
LENGTH
The total number of nodes in the coupled set
NCP
The coupled node reference number
Dlab
The degree of freedom label for the set
N1,N2,N3,N4,N5,N6,N7
The next seven node numbers in the coupled set
Cname
Eight character component name.
Entity
Label identifying the type of component (NODE or ELEMENT).
NUMITEMS
Number of items written.
Format
Data descriptors defining the format. For CMBLOCK this is always (8i10).
The items contained in this component are written at 10 items per line. Additional lines are repeated as needed
until all NumItems are defined. If one of the items is less than zero, then the entities from the item previous to
this one (inclusive) are part of the component.
NUM_NODES
The number of nodes to be read in the first line of an element definition.
Solkey
The solid model key.The element is part of a solid model if the keyword SOLID appears here.When Solkey
= SOLID, Field 8 (the element shape flag) may be left at zero, and Field 9 is the number of nodes defining
this element.
Format
Data descriptors defining the format.This must be 19i7.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 75
Chapter 3: Using CDREAD and CDWRITE
If you are in the GUI, the EBLOCK command must be contained in an externally prepared file and read into ANSYS
(i.e., CDREAD, /INPUT, etc.).
FREQ
The time interval between adaptive mesh refinement.
TOL
The adaptive angle tolerance (in degrees).
OPT
The adaptivity option.
MAXLVL
The maximum number of mesh refinement levels.
BTIME
The birth time to begin adaptive meshing.
DTIME
The death time to end adaptive meshing.
LCID
The curve ID defined by EDCURVE
ADPSIZE
The minimum element size to be adapted, based on the element edge length.
ADPASS
The one-pass or two-pass adaptivity option.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
76 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
3.3.6. EDCGEN Command
IREFLG
The uniform refinement level flag.
ADPENE
Adaptive mesh flag for starting adaptivity when approaching (positive ADPENE) or penetrating (negative
ADPENE) the tooling surface
ADPTH
Absolute shell thickness level below which adaptivity should begin.
MAXEL
The maximum number of elements at which adaptivity will be terminated.
NOTE: This command is also listed in the Commands Reference.The format listed here contians information spe-
cific to the CDREAD/CDWRITE file.
Option
The label identifying the contact behavior.
Cont
The contact surface, identified by component name, part ID, or part assembly ID.
Targ
The target surface, identified by component name, part ID, or part assembly ID.
Lkey
A key identifying the meaning of Cont and Targ (component, part or part assembly).
FS
The static friction coefficient.
FD
The dynamic friction coefficient.
DC
The exponential decay coefficient.
VC
The coefficient of viscous friction.
VDC
The viscous damping coefficient in percent of critical damping.
V1,V2,V3,V4
Additional input for some contact types. See EDCGEN in the Commands Reference for more information.
BTIME
The birth time for which conatct definition will become active.
DTIME
The death time for which conatct definition will become inactive.
BOXID1
Contact volume as defined using EDBOX
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 77
Chapter 3: Using CDREAD and CDWRITE
BOXID2
Target volume as defined using EDBOX
NOTE: This command is also listed in the Commands Reference.The format listed here contians information spe-
cific to the CDREAD/CDWRITE file.
Option
The EDCURVE command option.The only valid option is ADD.
LCID
The curve ID.
Length
The number of data values for the abcissa array (Par1) and the ordinate array (Par2).
Par1
The abcissa values, repeat Length number of times.
Par2
The ordinate values, repeat Length number of times.
NOTE: This command is also listed in the Commands Reference.The format listed here contians information spe-
cific to the CDREAD/CDWRITE file.
Option
EDDRELAX command option.Valid options are ANSYS (relaxation is based on the implicit analysis, see the
EDDRELAX command in the Commands Reference) or DYNA, where the relaxation parameters are controlled
within the LS-DYNA analysis.The following arguments are valid for Option= DYNA only.
NRCYCK
The number of iterations between the convergence checks.
IRELAL
Automatic control based on Papadrakakis not active (0) or active (1).
EDTTL
The convergence tolerance when automatic control is used.
DRTOL
The convergence tolerance.
DFFCTR
The dynamic relaxation factor.
DRTERM
The termination time for dynamic relaxation.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
78 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
3.3.10. EDLOAD Command
TSSFDR
The scale factor for each computed time step.
NOTE: This command is also listed in the Commands Reference.The format listed here contians information spe-
cific to the CDREAD/CDWRITE file.
Option
The EDLCS command option.The only valid option is ADD.
CID
The coordinate system ID.
X1,Y1,Z1,
The X,Y,Z coordinate of a point on the local X-axis.
X2,Y2,Z2,
The X,Y,Z coordinate of a point on the local X-Y plane.
X3,Y3,Z3,
The X,Y,Z coordinate of the local origin.
NOTE: This command is also listed in the Commands Reference.The format listed here contians information spe-
cific to the CDREAD/CDWRITE file.
Option
The EDLOAD command option.The only valid option is ADD.
Lab
The load labels.
Key
The coordinate system number defined by EDLCS or the element face number for the pressure loading.
Cname
The name of the existing component or part number to which this load will be applied.
Length
The number of data values for the time array (Par1) and the load array (Par2).
Phase
Phase of the analysis in which the load curve is to be used.
Par1
The time values, with the number of values in the string defined by the Length argument (above).
Par2
The load values, with the number of values in the string defined by the Length argument (above).
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 79
Chapter 3: Using CDREAD and CDWRITE
LCID
The curve ID, created using the EDCURVE command. If LCID is nonzero, then Length= 1, and Par1 and
Par2 will be equal to 0.
Scale
The Scale Factor applied to the load curve.
Btime
The birth time.
Dtime
The death time.
NOTE: This command is also listed in the Commands Reference.The format listed here contians information spe-
cific to the CDREAD/CDWRITE file.
Nmat
The number of materials.
Npart
Number of parts, and also, the number of times to repeat the second Type,Mat,Real,Used input line.
Type
The element type number.
Mat
The material number.
Real
The real constant set number.
Used
The flag indicating if the part is used (1), or not used (0).
Nmat
The number of materials.
Npart
Number of parts, and also, the number of times to repeat the second Type,Mat,Real,Used input line.
PartID
The part number.
Type
The element type number.
Mat
The material number.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
80 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
3.3.12. EDWELD Command
Real
The real constant set number.
Used
The flag indicating how many elements use PartID. If USED = 0, PartID is not used.
There are two command formats (for spot and generalized welds).The command format for the spotweld appears
in Jobname.CDB as follows:
EDWELD,R5.3,Option,NWELD,N1,N2,SN,SS,EXPN,EXPS
Option
The EDWELD command option.The only valid option is ADD.
NWELD
The spotweld ID number.
N1
The node number of the first node connected by the spotweld.
N2
The node number of the second node connected by the spotweld.
SN
The normal force at the spotweld failure.
SS
The shear force at the spotweld failure.
EXPN
The exponent for spotweld normal force.
EXPS
The exponent for spotweld shear force.
The command format for the generalized weld appears in Jobname.CDB as follows:
EDWELD,R5.3,Option,NWELD,CNAME,,SN,SS,EXPN,EXPS,EPSF,TFAIL,NSW,CID
Option
The EDWELD command option.The only valid option is ADD.
NWELD
The generalized weld ID number.
CNAME
The name of the node component.
SN
The normal force at the weld failure.
SS
The shear force at the weld failure.
EXPN
The exponent for weld normal force.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 81
Chapter 3: Using CDREAD and CDWRITE
EXPS
The exponent for weld shear force.
EXPF
The effective plastic strain at ductile failure.
TFAIL
The time of failure of the weld.
NSW
The number of spotwelds for the generalized weld.
CID
The coordinate system ID as defined by the EDLCS command.
NOTE: This command is also listed in the Commands Reference.The format listed here contians information spe-
cific to the CDREAD/CDWRITE file.
3.3.13. EN Command
The EN command is used to define an element . If an element contains more than eight nodes, the EN command
is repeated until all nodes are defined.The command format in Jobname.CDB is:
EN,R5.5,Type,NUMN,I1,I2,I3,I4,I5,I6,I7,I8
The type of data to be defined.Valid labels are ATTR (read in element attributes), and NODE (read in nodes
defining the element).
NUMN
The number of nodes.
I1,I2,I3,I4I5,I6,I7,I8
The integer values to be read:
If Type is ATTR, the integer values are the element attributes. Attributes are in the order:
NUMN,MAT,TYPE,REAL,SECNUM,ESYS,NUMELEM,SOLID,DEATH,EXCLUDE
If Type is NODE, the integer values are the node numbers.
Type
The type of data to be defined. Valid labels are LOC (read in system origin), ANG (read in rotation angles),
and PRM (read in system parameters).
NCSY
The coordinate system reference number.
CSYTYP
The coordinate system type (0, 1, 2, or 3).
VAL1,VAL2,VAL3
Values to be read:
If Type is LOC, values are the system origin in global Cartesian coordinates.
If Type is ANG, values are the rotation angles in degrees.
If Type is PRM, values are the first and second parameters of the system.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
82 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
3.3.18. N Command
3.3.15. M Command
The M command defines a master degree of freedom.The command format in Jobname.CDB is:
M,R5.0,NODE,Dlab
NODE
The node number
Dlab
The DOF label
LENGTH
The total number of temperatures in the table.
Lab
The material property label. See the MP command description in Commands Reference for valid labels.
MAT
The material reference number.
STLOC
The starting location in the table for the next three property values.
VAL1,VAL2,VAL3
Property values assigned to three locations in the table starting at STLOC.
LENGTH
The total number of temperatures in the table
STLOC
The starting location in the table for the next three temperature values
TEMP1,TEMP2,TEMP3
Temperatures assigned to three locations in the table starting at STLOC
3.3.18. N Command
If the UNBLOCKED option is used with the CDWRITE command, then the N command defines a node.This is
also the method used for defining nodes in .CDB files before ANSYS 5.4.The command format in Jobname.CDB
is:
N,R5.3,Type,NODE,SOLID,PARM,VAL1,VAL2,VAL3
Type
The type of data to be defined. Valid labels are LOC (read in coordinates) and ANG (read in rotation angles).
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 83
Chapter 3: Using CDREAD and CDWRITE
NODE
The node number.
SOLID
The solid model reference key. Not present for Type= ANG.
PARM
Line parameter value (0 if not on line). Not present for Type= ANG.
VAL1,VAL2,VAL3
Values to be read:
If Type is LOC, values are the coordinates in the global Cartesian system.
If Type is ANG, values are the rotation angles in degrees.
NUMFIELD
The number of fields in the blocked format.
Solkey
The solid model key.The node is part of a solid model if the keyword SOLID appears here.
Format
Data descriptors defining the format.This must be (3i8,6e16.9).
Only the last nonzero coordinate/rotation is output; any trailing zero values are left blank.
The final line of the block is always an N command using a -1 for the node number.
The following example shows a typical NBLOCK formatted set of node information. Note that this example has
no rotational data. It contains only the first six fields.
NBLOCK,6
(i8,6e16,9)
1 6.21299982 0.625999987 -1.019883480E-07
2 6.14472103 0.625999987 0.156284466
3 6.21271753 0.625999987 1.096193120E-02
.
.
.
151464 0 0 5.85640764 -0.442010075 1.911501959E-02
151465 0 0 5.88715029 -0.442010075 7.201258256E-08
151466 0 0 5.85541868 -0.442010075 7.201258256E-08
N, R5.3,LOC, -1
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
84 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
3.3.22. SECBLOCK Command
If you are in the GUI, the NBLOCK command must be contained in an externally prepared file and read into ANSYS
(i.e., CDREAD, /INPUT, etc.).
3.3.20. R Command
The R command defines a real constant set.You repeat the command until all real constants for this set are
defined.The command format in Jobname.CDB is:
R,R5.0,NSET,Type,STLOC,VAL1,VAL2,VAL3
NSET
The real constant set reference number.
Type
The type of data to be defined. LOC is the valid label.
STLOC
The starting location in the table for the next three constants.
VAL1,VAL2, VAL3
Real constant values assigned to three locations in the table starting at STLOC.
NUMSETS
The number of real constant sets defined
MAXSET
Maximum real constant set number
MAXITEMS
Maximum number of reals in any one set
NPERLINE
Number of reals defined on a line
Format1
Data descriptor defining the format of the first line. For the RLBLOCK command, this is always (2i8,6g16.9).
The first i8 is the set number, the second i8 is the number of values in this set, followed by up to 6 real constant
values.
Format2
Data descriptors defining the format of the subsequent lines (as needed); this is always (7g16.9).
The real constant sets follow, with each set starting with Format1, and followed by one or more Format2's as
needed.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 85
Chapter 3: Using CDREAD and CDWRITE
Format2
Format3
Format1
The First Line section.The first value is the number of nodes, and the second is the number of cells.
Format2
The Cells Section.The first 9 values are the cell connectivity nodes.The 10th (last) value is the material ID
(MAT).
Format3
The Nodes Section.This section contains as many lines as there are nodes. In this example, there are 27 nodes,
so a total of 27 lines would appear in this section. Each node line contains the node's boundary flag, the Y
coordinate of the node, and the Z coordinate of the node. Currently, all node boundary flags appear as 0s
in a cell mesh file. Because all node boundary flags are 0, SECBLOCK ignores them when it reads a cell mesh
file.
Following is a sample excerpt from a custom section mesh file for a section with 27 nodes, 4 cells, and 9 nodes
per cell:
First Line: 27 4
Cells Section: 1 3 11 9 2 6 10 4 5 2
7 9 23 21 8 16 22 14 15 1
9 11 25 23 10 18 24 16 17 1
11 13 27 25 12 20 26 18 19 1
ELEM
The element number.
LKEY
The load key associated with these surface loads.
Lab
A label indicating the type of surface load. PRES (for pressure) is the only valid label.
DIOFFST
Offset distance from node I.
DJOFFST
Offset distance from node J.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
86 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
3.3.24. SFE Command
ELEM
The element number.
LKEY
The load key associated with this surface load.
Lab
A label indicating the type of surface load: Valid labels are:
PRES (pressure)
CONV (convection)
HFLU (heat flux)
IMPD (impedance)
SEL (substructure load vector)
SELV (S. E. load vectors)
CHRG (charge density)
KEY
A value key. If it is 1, the values are real (film coefficient if convection). If it is 2, values are imaginary (bulk
temperature if convection).
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 87
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
88 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 4: ANSYS Graphics File Format
4.1. Modifying ANSYS Graphics Files
Some ANSYS users may wish to translate ANSYS graphics files to other formats (such as Encapsulated PostScript
or AI). If you plan to translate graphics files, this chapter provides some information to help you:
Source code, with comments, for a program called PLOT33 which plots all of the plots on the coded plot
file.You can link this program with user-supplied Calcomp HCBS software (plot, plots, symbol) or other
software that uses the Calcomp subroutine protocol. For example, Hewlett-Packard's ISPP product, Tek-
tronix's Preview product, and Veratec's Versaplot product use the Calcomp protocol.
To work with other plotter software, you may need to remove the calls to the Calcomp subroutine (plot,
plots, and symbol) and substitute the subroutine calls for the plotter software being used.
Note
Because ANSYS customers use a wide variety of plotters, ANSYS, Inc. can not verify the use of
the PLOT33 program with all plotter types.
A description of the format for the ANSYS neutral graphics file.This listing excludes format information
for z-buffered graphics, but the PLOT33 program does include a section on z-buffered graphics.
KPX is the resolution specified by the /GFILE,SIZE command (where SIZE is the pixel resolution) or by choosing
menu path Utility Menu>PlotCtrls>Redirect Plots>To File. Default resolution is 800.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 89
Chapter 4: ANSYS Graphics File Format
(IX1,IY1)
(0,0) (KPX*1.33,0)
Most ANSYS users will not need to know the format of the graphics file. However, in rare cases, you may want
to edit your graphics file or, as a programmer, you may need to know the file format to write a program that
reads it. Although the file is ASCII coded, it can be difficult to interpret.This section gives details about the file
format.
Numerals 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9
Uppercase alphabetic characters A through Z
The following characters: $ ( ) * + , - . < = >
The space character, " ".
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
90 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
4.3.2. Graphics File Directives
Within a graphics file, one directive directly follows the preceding directive. For example, below is the first line
of a graphics file:
(BBAAA2A0AAAAAAPPPLPO>AP$MEKLKBAJANSYS 5.3$MEKLEFALNOV 15 1996$MEKKOJAI10:01:40
The descriptions of graphics file directives in the next section include discussions of the parameter or parameters
for each directive.There are five types of parameters:
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 91
Chapter 4: ANSYS Graphics File Format
The next few pages describe each of the graphics file directives. Parameters are always specified in the order
shown below.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
92 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
4.3.2. Graphics File Directives
Below is the list of color specifications used by the directives that set colors for areas, graphs, and text. If more
than a single intensity of a color is available, use the value specified by the Normal directive to complete the
selection. Normal of 0 represents the lowest intensity and normal of 255 represents the highest intensity.
Value Color
0 Black
1 Cyan
2 Blue-Magenta
3 Red
4 Cyan-Blue
5 Magenta-Red
6 Green
7 Orange
8 Magenta
9 Yellow-Green
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 93
Chapter 4: ANSYS Graphics File Format
Value Color
10 Blue
11 Green-Cyan
12 Yellow
13 Dark Gray
14 Light Gray
15 White
16
: Reserved for future use
127
128 Blue
: :
Cyan
:
Green
:
Indices 128 through 255 repres-
ent the color spectrum used to
display the Low (Blue) to High
(Red) contour values.
:
Yellow
:
Orange
: :
255 Red
The ANSYS command stream used to create a simple graphics plot, shown in Figure 4.2,Example Display
of a Graphics File below
The encoded graphics file that these commands produce
The decoded graphics plot directives
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
94 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
4.4.2. Example Graphics File Contents
1 ANSYS 5.3
3 4 NOV 15, 1996
15:57:07
PLOT NO. 1
ELEMENTS
ELEM NUM
ZV =1
DIST=0.55
XF =1.5
YF =0.5
CENTROID HIDDEN
1 2
ANSYS 5.3 Example Graphics File
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 95
Chapter 4: ANSYS Graphics File Format
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
96 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
4.4.2. Example Graphics File Contents
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 97
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
98 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
Part II, Guide to ANSYS User Programmable
Features
Chapter 5: Using User Programmable Features
(UPFs)
Because the ANSYS program has an open architecture, you can write your own routines or subroutines in C or
FORTRAN and either link them to ANSYS or use them as external commands. In fact, some of the ANSYS features
you see today as "standard" offerings originated as user programmable features (UPFs).You can take advantage
of UPFs if you are licensed for any of the following products:
ANSYS Multiphysics
ANSYS Mechanical
ANSYS Structural
ANSYS PrepPost
ANSYS Academic Associate
ANSYS Academic Research
ANSYS Academic Teaching Advanced
ANSYS Academic Teaching Mechanical
To read information into or fetch information from the ANSYS database, you can create subroutines and
either link them into the ANSYS program or use them in the external command feature (see Appendix A:,
Creating External Commands in UNIX for more information about external commands). If you link these
subroutines into ANSYS, you are limited to 10 database access commands. Such commands, created
through either method, operate at all levels of ANSYS operation, including the begin, preprocessor, gen-
eral postprocessor, time-history postprocessor, and solution levels. For more information about accessing
the ANSYS database, see Chapter 7: Accessing the ANSYS Database.
ANSYS provides a set of routines you can use to specify various types of loads, including BF or BFE loads,
pressures, convections, heat fluxes, and charge densities.These routines are described under Section 6.5:
Routines for Customizing Loads.
Another set of UPF routines enables you to define the following material properties: plasticity, creep,
swelling law, viscoplasticity, hyperelasticity, and layered element failure criteria.To see inputs and outputs
for these routines, see Section 6.4: Routines for Customizing Material Behavior.
Several sets of UPFs enable you to define new elements and to adjust the nodal orientation matrix. See
Section 6.1: Creating a New Element for more information.
Another group of UPFs enables you to modify and monitor existing elements. For details, see Section 6.3:
Routines for Modifying and Monitoring Existing Elements.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 101
Chapter 5: Using User Programmable Features (UPFs)
You can customize UPF userop to create a custom design optimization routine. For more information,
see Section 6.10: Creating Your Own Optimization Routine.
You can call the ANSYS program as a subroutine in a program you have written.To learn how, see Section 6.6:
Running ANSYS as a Subroutine.
The UPF subroutines are written in FORTRAN 90; some extensions are used.They contain comments intended
to give you enough detail to develop your own versions of the subroutines.
User routines that can be modified have the word user in the first line of the routine. Other routines and functions
described in this document that do not have user in the first line cannot be modified and must be used as is.
To use UPFs successfully, you need strong working knowledge of the following:
Important
UPFs are not available or will behave unpredictably in certain data center environments or on some
hardware configurations.You should take special care when using UPFs on parallel systems.You should
never use the /CONFIG command or a config.ans file to activate parallelization on a system with UPFs.
For additional information, consult your ANSYS installation manual or your on-site ANSYS system support
person
Carefully consider whether you wish to use UPFs, especially if you are linking them into ANSYS (rather
than into a shared library for use as external commands). When you add your own routines to ANSYS by
either method, you are creating a customized, site-dependent version of the program. ANSYS, Inc. considers
the use of UPFs a nonstandard use of the program, one that the ANSYS Quality Assurance verification
testing program does not cover.Therefore, you are responsible for verifying that the results produced
are accurate and that your customizations do not adversely affect unchanged areas of the ANSYS program.
Although the flexibility that UPFs offer can be highly attractive, UPF usage is a complicated process that
can introduce errors. Consider what you want your customizations to accomplish.You may be able to
customize ANSYS more easily and safely with macros than with UPFs.
For other guidelines for nonstandard uses of the ANSYS program, see the Advanced Analysis Techniques Guide.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
102 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
5.6. Developing UPFs: a Suggested Strategy
Does the capability you want already exist in the ANSYS program? Remember, a capability may not be
obvious at first, especially to a novice ANSYS user.
Does your proposed subroutine fit into the ANSYS program architecture and specifications? For example,
you can not program a user element that has more than 32 degrees of freedom per node.
Use your experience and judgment to answer these questions. If you need help to do so, consult your ANSYS
Support Distributor. If you can respond "no" to both questions, then the user routine you are planning will be
both useful and feasible.
If you have a UNIX version of ANSYS, the source code for the UPF routines resides in directory /an-
sys_inc/v110/ansys/customize/user/<platform>.
If you are running the ANSYS program under Windows, the UPF source code resides in directory Program
Files\Ansys Inc\V110\ansys\custom\user\<platform>.
Most of the user routines have at least simple functionality, so print out the routines of interest before you start
programming. All source routines are concatenated onto file user.f or user.for. Delete the routines you
do not want and make appropriate changes to the others.
You need to take care when calling FORTRAN subroutines from C subroutines.You must use the symbol associated
with the FORTRAN subroutine when invoking the subroutine from a C function.This symbol typically differs
slightly from the FORTRAN subroutine name, and is extremely system dependent.
On many UNIX systems, you build this symbol name by taking the FORTRAN subroutine name, converting it to
lower case, and appending an underscore. For example, the symbol name for the FORTRAN subroutine
HeapInquire would be heapinquire_.You would have to use the symbol heapinquire_ in the invoking C
function to avoid an unsatisfied external reference when the program is linked.
Keep in mind that the instance described above is just an example. Compilers from different vendors may construct
the symbols differently. Please consult the manuals for your specific compiler for information on how to call
FORTRAN subroutines from C functions.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 103
Chapter 5: Using User Programmable Features (UPFs)
The example procedure below illustrates this type of gradual process.The example assumes that you are creating
a new element for the ANSYS program using the method described in Section 6.1.2: Creating a New Element by
Directly Accessing the ANSYS Database.You develop and test it by performing these steps:
1. Get the applicable element subroutines for uel101 from the ANSYS distribution medium. Add a small
change (such as a misspelling in an output heading), then compile and link the subroutines.
2. Using a production version of the ANSYS program, run several analysis problems using LINK8 (and maybe
other elements) to form a base for comparison.
3. Replacing LINK8 with USER101, run the same problem on your custom version of ANSYS.
4. Compare the results from Steps 2 and 3. If they show discrepancies other than the misspelled output
heading, resolve them before you go on to Step 5.
5. Choose the standard ANSYS element that most closely resembles your new custom element, and run
some problems on a production version of ANSYS using that element.
6. Modify the element subroutines to match the element you chose in Step 5.Then, compile and link those
subroutines into a custom version of ANSYS.
7. Again, compare the results from Steps 5 and 6. If they don't match, resolve the discrepancies before
moving on to Step 8.
8. Modify your element subroutines to include the features you want.Then, compile and link the subroutines
into a custom version of ANSYS.
9. Test the changes with a series of increasingly complex problems for which you already know the answers.
To insert include decks in a subroutine or function, use the INCLUDE (or an analogous) statement. Do not modify
an include deck under any circumstances.The following table lists some of the more commonly used ANSYS include
files and the definitions they contain:
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
104 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
5.9. Compiling and Linking UPFs on UNIX Systems
Include File
Description
stack.inc Defines stack storage.You must include this common in any
routines that access stack space.
stepcm.inc Contains load step information
usvrcm.inc Defines storage of user-defined variables
Link your routines into shared libraries (as discussed starting in Appendix A:, Creating External Commands
in UNIX).
Compile and link your custom routines into the ANSYS program itself.This is discussed for UNIX systems
in Section 5.9: Compiling and Linking UPFs on UNIX Systems and for Windows systems in Section 5.10: Com-
piling and Linking UPFs on Windows Systems.You may need superuser or root privileges to run the procedure
that does the linking.
When you run a user-linked version of the ANSYS program, the ANSYS output will include the following:
NOTE: This ANSYS version was linked by Licensee
The Relink ANSYS option compiles all FORTRAN files (files ending with .F) and all C files (files ending with .c)
in the current working directory.The procedure then loads all object files (files ending with .o) along with the
default ANSYS objects and libraries in /ansys_inc/v110/ansys/customize/user/<platform> (where
platform is a directory that uniquely identifies the hardware platform version).The new executable file created
will be named ansyscust.e110 and will reside in the current directory.
FORTRAN files are assumed to be FORTRAN 90 (some extensions are allowed), and C files are assumed to be
ANSI C.
When relinking on UNIX systems, you can choose to link a distributed version of ANSYS as well. If you choose to
link a distributed version, the executable (ansyscustdis.e110) must reside in the same directory path on
all systems. However, you need to link it on only one system; you can then copy the executable to the other
systems.You cannot link a distributed version on Windows systems.
The Installation and Configuration Guide lists the compilers you will need to use UPFs.
Creating a Shared Library You can also set up UPFs on some UNIX and Linux systems through a shared library
as an alternative to creating a custom ANSYS executable. Copy the ANSUSERSHARED script from /an-
sys_inc/v110/ansys/customize/user/<platform> into your working directory. All Fortran (*.F)
and C (*.c) files that you want to include in your shared library should also reside in your working directory.To
compile all *.F and *.c routines, issue the following command:
sh ./ANSUSERSHARED
If the compile was successful, you will be asked if a shared file is to be created. Choose Yes to create a shared
library named libansuser.so (or .sl).
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 105
Chapter 5: Using User Programmable Features (UPFs)
To use this library, set the ANS_USER_PATH environment variable to point to the working directory where the
libansuser shared library resides. Use one of the following commands, depending on the UNIX shell you are
using:
setenv ANS_USER_PATH workingdirectory
or
export ANS_USER_PATH=workingdirectory
When you run a user-linked version of the ANSYS program, the ANSYS output will echo the value of
ANS_USER_PATH and will include the following:
NOTE: This ANSYS version was linked by Licensee
To return to the original version of ANSYS, unset the ANS_USER_PATH environment variable.
ANSYS recommends using the ANSUSERSHARED script as a template to try compilers that are not supported
by ANSYS, Inc., such as the GNU compilers.To do so, edit the ANSUSERSHARED script, making changes to the
appropriate platform logic. Note that if you do use compilers other than those listed in the ANSYS Installation
and Configuration Guides, you will need to debug (i.e., find missing libraries, unsatisfied externals, etc.) them
yourself. ANSYS, Inc. does not provide assistance for customers using unsupported compilers or if the resulting
objects are not compatible with the ANSYS executable(s) as distributed.
Note
Note
If you intend to modify any of the user routines, make a duplicate copy of the Program
Files\Ansys Inc\V110\ansys\custom\user\<platform> directory to preserve the
original files for later use, if necessary.
If you modify any of these subroutines, select the Relink ANSYS option from the ANS_ADMIN utility to link
these changes into the ANSYS program.This procedure compiles all FORTRAN files (files ending with .F) and
all C files (files ending with .c) in the Program Files\Ansys Inc\V110\ansys\custom\user\<plat-
form> directory.The procedure then loads all object files (files ending with .obj), along with the default ANSYS
objects and libraries.The executable file created will be named ansys.exe and will reside in Program
Files\Ansys Inc\V110\ansys\custom\user\<platform>.
Note
ANS_ADMIN does not exist on Windows 64-bit systems. In order to relink on Itanium systems, you
must open a command prompt window, set your current directory to Program Files\Ansys
Inc\V110\ansys\custom\user\win64, and run ANSCUST.
When relinking on a Windows system, you can choose to link with the small export list (Do you want to link with
the small export list?).
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
106 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
5.11. Activating UPFs
Answer No to link ANSYS with all symbols exported (which may be required by third party interfaces).
The link time will be significantly longer.The ANSYS executable provided on the media is linked using
this option, and ANSYS recommends that you select this option.
Answer Yes to link ANSYS with the minimum amount of symbols needed to be exported for ANSYS to
run. Select this option for the fastest link time.
Caution
When creating a custom ANSYS executable, the executable must be named ansys.exe.This re-
quirement is due to shared library usage.
After relinking the ANSYS executable, the program can be executed by either of the following two methods:
Batch:
ansys110 -custom <path> -b -p <product variable>-j jobname -i <input file> -o <output file>
Note
Note
You will need all the compilers specified in the Installation and Configuration Guide to use these
user programmable features.The user programmable features are loaded onto the system only if
you perform a custom installation and choose to install the customization tools.
UPFs that are not activated by the means described above must be activated by either of the following methods:
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 107
Chapter 5: Using User Programmable Features (UPFs)
To activate or deactivate the routines, issue the command USRCAL,Rnam1, ...Rnam9, where Rnam1 and Rnam9
are the names of specific routines.You can specify up to nine routines with one USRCAL command, or you can
issue multiple USRCAL commands.
Issue the command USRCAL,NONE to deactivate all valid user subroutines.To list the status of the routines, issue
the command USRCAL,STAT.
For a list of the user routines that the USRCAL command (or its equivalent menu paths) affects, see the USRCAL
command description in the Commands Reference.
If you do not activate the UPFs in this manner, standard ANSYS logic will be used by default. For instance, when
you apply a convection load, standard ANSYS logic is the default even if you have a user convection routine
linked in.The user convection routine must be activated by the USRCAL command or its menu equivalent.
Enter the full pathname to the custom executable in the ANSYS Custom Exe field. Do not include the -custom
argument.
When run from the command prompt, if no path is specified after the -custom argument, the ansys110 script
searches the current working directory for the custom ANSYS executable (ansyscust.e110 by default on
UNIX or ansys.exe on Windows). If the custom ANSYS executable resides in a separate directory (or has a
name other than ansyscust.e110 on UNIX), you can specify a different path and filename after the -custom
argument.
Caution
If you are running on a Windows system and you create a custom ANSYS executable, the executable
must be named ansys.exe.This requirement is due to shared library usage.
On UNIX, you can also run your custom executable via command line.
ansys110 -custom /pathname/ansyscust.e110
Make certain that your custom version of the ANSYS program performs correctly for the combinations of elements,
analysis types, materials, boundary conditions, and so on. that you plan to use. Confirm that the logic you intro-
duced is correct and does not produce any unwanted side effects.
In testing your custom user routines, you also should verify that the changes you have made do not affect
standard, non-customized ANSYS features.To do so, you can compare the results of a set of problems from the
Verification Manual run on the standard version and on the customized version. Input for these problems is also
available on your ANSYS distribution medium.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
108 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
5.14.2. Debugging Elements and Solutions
Always remember: your last step, a series of steps, or even your concept may be wrong. Proceed in clear steps,
and verify your work as often as possible. Keep intermediate versions of your modified source code on backup
media.
Note
If you contact your site's ANSYS system support person or any ANSYS, Inc. representative about the
performance of a custom version of ANSYS, always tell him or her explicitly that you are using a user
programmable feature. If you feel that an error exists in an unrelated feature of the ANSYS program,
demonstrate the suspected error in an non-customized, production version of the program before
you report the error to an ANSYS. Inc. representative.
MonLevel
The level for timing monitoring.
PrintLevel
The level for enter/exit printout.
SumLevel
The level at which the timing sum is output.
Each of these arguments can be any value between 0 and 9 (default is 0).
You can use the /TRACK command to identify which section of code is causing the program to abort. For example,
to flag up to eight levels of subroutines to determine when the program logic enters and leaves them, you would
issue the command /TRACK,,8.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 109
Chapter 5: Using User Programmable Features (UPFs)
F1
1 (provides basic solution control debugging)
F2
1 (provides transient debugging using Newmark constants)
2 (provides element matrix debugging with load vectors only, before going into solve)
3 (provides element matrix debugging with matrix diagonals and load vectors, before going into solve)
F4
1 (provides auto time stepping debugging)
F5
1 (provides multifield debugging)
F6
1 (provides arc-length debugging)
F7
1 (provides basic Newton-Raphson debugging)
3 (provides Newton-Raphson debugging and prints applied loads and n-r restoring force for each DOF)
F8
1,2 (provides displacement vector debugging with displacement pointers)
G1
1 (provides basic element pass debugging)
G2
1 (provides element displacement and coordinate debugging)
G3
1 (provides element matrix debugging and prints matrix + load vectors, after the element routines)
2 (provides element matrix debugging with load vectors only, after the element routines)
3 (provides element matrix debugging with matrix diagonals and load vectors, after the element routines)
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
110 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
5.15. Other Useful Commands
G4
1 (provides element load information debugging)
G5
1 (provides element real constant debugging)
G6
1 (provides element saved variable debugging)
G7
1 (provides element material property debugging with linear material properties)
H1
1 (provides file header record information)
-99 (resume only the command log information for subsequent LGWRITE command)
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 111
Chapter 5: Using User Programmable Features (UPFs)
Issue the /UCMD command to make a user routine into a custom command. For more information, see Section 6.7:
Defining Your Own Commands.
You can shorten the time ANSYS takes to read such files by including two commands in your programs, UPFs,
or macros: EBLOCK and NBLOCK.The NBLOCK command converts nodal data into fixed format data blocks
(which ANSYS can read more quickly than commands).The EBLOCK command places element data into a fixed
format block, one line per element.These commands also compress displacement constraint data to one line
per constraint node. See Chapter 3: Using CDREAD and CDWRITE in the Guide to Interfacing with ANSYS for more
information on the use of these commands.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
112 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 6: UPF Routines and Functions
This chapter describes the various routines, functions, and commands that allow you to customize the ANSYS
program for your specific purpose.The first portion of the each routine or function (consisting of comment lines)
is shown in most cases.
User routines that can be modified have the word user in the first line of the routine. For example, the first line
of the userop routine looks like this:
*deck,userop user
User routines that do not have user in the first line cannot be modified and must be used as is.
ANSYS recommends the user-defined element API in most cases.The direct-access method is generally for special-
purpose use only, or if you are already using preexisting elements created with this method.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 113
Chapter 6: UPF Routines and Functions
Each node will have the same DOFs. Although you can specify any valid DOFs,
the total number of DOFs for your element cannot exceed 480, and the number
of DOFs for each node cannot exceed 32.
4. Define real constants. If needed.
5. Create finite element Use either of these methods:
models.
Direct generation -- Create elements directly from nodes, using commands
such as E, EGEN, EN, ENGEN, or EMORE. (You can also use the CDREAD
command if the .cdb file is available.) This method is the only way to create
an element with a topology different from that of any standard ANSYS element.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
114 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.1.1. Creating a New Element via the User-Defined Element API
Meshing commands -- This method is available only if your element has the
same topology as that of a standard ANSYS element and you have specified
any standard element shape (USRELEM KeyShape value) except ANYSHAPE.
Only total strain (or equivalent quantities such as thermal gradient) and stress (or
equivalent quantities such as thermal flux) are saved as regular result quantities.
Other variables are saved as nonsummable miscellaneous variables in the results
file.
Note
Steps 2 and 3 specify data for the ANSYS user-defined element API. All other steps represent standard
ANSYS features.
Verify that your input data for the USRELEM and USRDOF commands are consistent with the values used
in the UserElem.F code. For example, if the number of dimensions (NDIM) specified via the USRELEM
command is 2, do not change the number of dimensions specified in the UserElem.F routine from 2.
A runtime error or incorrect results can occur if the values do not match.
ANSYS may activate default solution settings automatically according to the USER300 element's DOFs,
but the default solution control settings may not be optimal for your element. If any convergence difficulty
occurs, try disabling the default solution settings (SOLCONTROL,OFF).
The USER300 element does not support ANSYS section (SECxxx) commands. For composite beams and
layered shells, you must input element data via real constants and code the UserElem.F routine accord-
ingly.
The UserElem routine provides an interface to ANSYS code above the element level.The routine passes all
data needed to create a user-defined element and returns all data and results from the element to update the
ANSYS database and files.With this API, you can create virtually any element type without having to access ANSYS
database and files directly.Two examples are included in this routine: a 4-node quadrilateral 2-D element, and
20-node brick structural element, both for geometric linear analysis. Key options (KEYOPT settings) switch the
elements.
The following table shows the input and output arguments, and their definition and usage. Some argument
names (such as those pertaining to element matrices and load vectors) are common to structural analyses;
however, you can specify argument values appropriate to analyses in other engineering disciplines.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 115
Chapter 6: UPF Routines and Functions
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
116 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.1.1. Creating a New Element via the User-Defined Element API
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 117
Chapter 6: UPF Routines and Functions
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
118 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.1.1. Creating a New Element via the User-Defined Element API
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 119
Chapter 6: UPF Routines and Functions
*deck,UserElem user
subroutine UserElem (elId, matId, keyMtx, lumpm, nDim, nNodes,
& Nodes, nIntPnts, nUsrDof, kEStress,
& keyAnsMat, keySym, nKeyOpt, KeyOpt,
& temper, temperB, tRef, kTherm,
& nPress, Press, kPress, nReal, RealConst,
& nSaveVars, saveVars, xRef, xCur,
& TotValDofs, IncValDofs, ItrValDofs,
& VelValDofs, AccValDofs,
& kfstps, nlgeom, nrkey, outkey, elPrint, iott,
& keyHisUpd, ldstep, isubst, ieqitr, timval,
& keyEleErr, keyEleCnv,
& eStiff, eMass, eDamp, eSStiff,
& fExt, fInt, elVol, elMass, elCG,
& nRsltBsc, RsltBsc, nRsltVar, RsltVar,
& nElEng, elEnergy)
&
c*************************************************************************
c
c *** Primary function: General User Element Subroutine
c *** Note:
c This routine is completed with an example, see more details later.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
120 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.1.1. Creating a New Element via the User-Defined Element API
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 121
Chapter 6: UPF Routines and Functions
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
122 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.1.1. Creating a New Element via the User-Defined Element API
6.1.1.2. Subroutine ElemGetMat (Calling the ANSYS Standard Structural Material Library)
The ElemGetMat routine is the API to the ANSYS materials. When you issue the USRELEM command after
setting the command's KEYANSMAT argument, the routine accesses the ANSYS standard structural material
library. It allows you to focus on the kinematic portion of element formulation while ANSYS handles the material
part of the formulation. When calling the routine, input the associated material data via the standard method.
There is no need to access this routine, only to call it.
The following table shows the input and output arguments, and their definition and usage.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 123
Chapter 6: UPF Routines and Functions
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
124 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.1.1. Creating a New Element via the User-Defined Element API
1. All tensor component values in the routine are in the global Cartesian coordinate system for solid elements,
and in the co-rotated element Cartesian coordinate system for link, beam and shell elements.
*deck,ElemGetMat
c*************************************************************************
c
c *** Primary function: call ANSYS material routines to obtain material
c data for USER300 elements
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 125
Chapter 6: UPF Routines and Functions
The descriptions of the routines or functions within this chapter describe both the input arguments and output
arguments. Argument information includes the argument's type, size and intent.
int - integer
dp - double precision
log - logical
chr - character
dcp - double precision complex
Argument size is one of the following:
sc - scalar variable
ar(n) - array variable of length n
func - functional return value
Argument intent is one of the following:
in - input argument
out - output argument
inout - both an input and an output argument
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
126 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.1.2. Creating a New Element by Directly Accessing the ANSYS Database
Routines uec100 through uec105 describe the element characteristics. Routine elccmt (on the distribution
medium) describes the input for these routines in detail.You can use subroutines uex100 through uex105 to
override default logic. Routines uec100 through uec105 define parameters such as:
Routines uel100 through uel105 calculate the element matrices (stiffness, specific heat, and so on), the element
load vector (force, heat flow, and so on), and any element output quantities.The element printout also is generated,
and the variables to be saved are calculated and stored in the results file.
Other user routines available for manipulating element information include the following:
Routines uep100 through uep105 provide printed output of line elements.The general ANSYS postpro-
cessor, POST1, calls the subroutines, or you can call them using uel100 through uel105.
Routine usertr allows access to the nodal transformations.
Routine userac describes some of the data handling.
*deck,uec100 user
subroutine uec100 (elcdn,ielc,kerr)
c ***** this subroutine defines the characteristics of user100.
c
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
c *** Notice - This file contains ANSYS Confidential information ***
c
c typ=int,dp,log,chr siz=sc,ar(n) intent=in,out,inout
c
c input arguments:
c variable (typ,siz,intent) description
c ielc (int,ar(IELCSZ),inout) - element characteristics
c
c kerr (int,sc,inout) - error flag up to this point.
c (do not initialize to zero)
c
c output arguments:
c variable (typ,siz,intent) description
c elcdn (chr,sc,out) - name of element
c ielc (int,ar(IELCSZ),inout) - element characteristics
c
c kerr (int,sc,inout) - error flag (set to 1 if error)
c note to programmers: the validity of keyopt values may be checked here
c
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 127
Chapter 6: UPF Routines and Functions
The input and output arguments for subroutines uec101, uec102, uec103, uec104, and uec105 is
identical to the uec100 subroutine listed above.
*deck,uex100 user
subroutine uex100 (ielc,kerr)
c *** subroutine to override element characteristic defaults ***
c *** hence, this routine is needed only in rare cases.
c
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
c *** Notice - This file contains ANSYS Confidential information ***
c
c *** input and output are the same as for uec100, except that this
c *** logic is called after the defaulting logic is finished.
c *** this defaulting is done in ansys subroutine echdft(not a upf).
c *** as indicated above, this routine is rarely needed, but if it is
c *** desired to see the effect of echdft, you may print out the ielc array
c *** leaving uec100 and print it out again entering this routine.
c
c typ=int,dp,log,chr siz=sc,ar(n) intent=in,out,inout
c
c input arguments:
c variable (typ,siz,intent) description
c ielc (int,ar(IELCSZ),inout) - element characteristics
c
c kerr (int,sc,inout) - error flag up to this point.
c (do not initialize to zero)
c
c output arguments:
c variable (typ,siz,intent) description
c ielc (int,ar(IELCSZ),inout) - element characteristics
c
c kerr (int,sc,inout) - error flag (set to 1 if error)
c *** standard defaults are taken. the final results are given with
c *** the debug accessed with /debug,,, ,,1
c
The source code for subroutines uex101, uex102, uex103, uex104, and uex105 is identical to the code for
subroutine uex100 listed above.
6.1.2.5. Subroutine uel100 (Computing Element Matrices, Load Vectors, and Results)
*deck,uel100 user
subroutine uel100 (elem,ielc,elmdat,eomask,nodes,locsvrL,kelreq,
x kelfil,nr,xyz,u,kelout,zs,zass,damp,gstif,zsc,zscnr,elvol,elmass,
x center,elener,edindxL,lcerstL)
c --- general lumped mass is demonstrated --------------------------------
c *** primary function:
c 1. compute element matrices, load vectors, and results
c *** secondary functions:
c 2. maintain element solution data
c *** user programmable functions may not be used in parallel processing ***
c input arguments:
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
128 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.1.2. Creating a New Element by Directly Accessing the ANSYS Database
c output arguments:
c kelout (int,ar(10),out) - keys indicating created matrices and
c load vectors (indices for kelout
c are the same as for kelreq below,
c as well as kelin and kelout later)
c zs (dp,ar(nr,nr),inout)- stiffness/conductivity matrix (kelreq(1))
c zass (dp,ar(nr,nr),inout)- mass matrix (kelreq(2))
c damp (dp,ar(nr,nr),inout)- damping/specific heat matrix (kelreq(3))
c gstif (dp,ar(nr,nr),inout)- stress stiffness matrix (kelreq(4))
c zsc (dp,ar(nr),out) - applied f vector (kelreq(5))
c zscnr (dp,ar(nr),out) - n-r restoring f vector (kelreq(6))
c or imaginary f vector (kelreq(7))
c elvol (dp,sc,out) - element volume
c elmass (dp,sc,out) - element mass
c center (dp,ar(3),out) - centroid location
c elener (dp,ar(5),out) - element energies
c edindxL(LONG,ar(25),out) - element result data file indexes
c lcerstL(LONG,sc,inout) - position on result file
c
The input and output arguments for subroutines uel101, uel102, uel103, uel104, and uel105 is
identical to subroutine uel100 listed above.
6.1.2.6. Subroutine uep100 (Printing Output for User Elements in POST1 via PRESOL,ELEM)
*deck,uep100 user
subroutine uep100 (iott,elem,nodes,mat, kept,tem,
x kemn,fluen, kems,force, kens,sig, keel,epel,
x keth,eptho,epswel,epino, kenl,sigepl,sigrat,hpres,epeq,
x kepl,eppl, kecr,epcrp)
c
c *** primary function: produce printed output for user100
c
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
c *** Notice - This file contains ANSYS Confidential information ***
c
c ********** this subroutine is provided for user information *********
c *** user programmable features may not be used in parallel processing ***
c
c input arguments:
c iott (int,sc,in) - output unit number
c elem (int,sc,in) - element number
c nodes (int,ar(2),in) - node numbers
c mat (int,sc,in) - material number
c kept (int,sc,in) - key to print temperatures
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 129
Chapter 6: UPF Routines and Functions
The source code for subroutines uep101, uep102, uep103, uep104, and uep105 is identical to subroutine
uep100 listed above.
*deck,usertr user
subroutine usertr (node,tr)
c *** primary function: adjust nodal orientation matrix
c secondary function: study nodal orientation matrix
c accessed with ielc(notran) = -100
c
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c typ=int,dp,log,chr,dcp siz=sc,ar(n) intent=in,out,inout
c
c input arguments:
c variable (typ,siz,intent) description
c node (int,sc,in) - node number being acted upon
c tr (dp,ar(32,32),inout) - nodal to global orientation matrix
c
c output arguments:
c variable (typ,siz,intent) description
c tr (dp,ar(32,32),inout) - nodal to global orientation matrix
c
c tr is a matrix that is already defined based on the degrees
c of freedom selected.
c it does not normally need to be changed.
c it may be printed out here to study. its functional size is
c nr by nr, where nr is the number of degrees of freedom in the
c element
c
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
130 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.2.2. Subroutine svgidx (Fetching the Index for Saved Variables)
*deck,userac user
subroutine userac (elem)
c *** primary function: To demonstrate user access of element information.
c --- Given the element number, all information about the element is avaiable.
c --- Starting with elmdat, one can get the element type, real constant number,
c --- the material number, the element coordinate system number, as well as
c --- the node numbers. Then, one can get more information about any or all
c --- of these things. The below demonstrates getting the element type and
c --- real constants.
c
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
c *** Notice - This file contains ANSYS Confidential information ***
c
c input arguments:
c variable (typ,siz,intent) description
c elem (int,sc,in) - element number
c
c output arguments:
c none
c
*deck,nminfo
subroutine nminfo (ielc,rname)
c *** primary function: set element reference names
c *** secondary functions: none
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c input arguments:
c variable (typ,siz,intent) description
c ielc (int,ar(*),inout) - element characteristic vector
c rname (chr,sc,in) - 8 character reference name
c
c output arguments:
c variable (typ,siz,intent) description
c ielc (int,ar(*),inout) - element characteristic vector with
c element name encoded
c
*deck,svgidx
subroutine svgidx (locsvr,svindx)
c *** primary function: get the index for saved variables
c input arguments:
c locsvr (LONGINT,sc,in) - pointer to location of index
c output arguments:
c svindx (int,ar(20),out) - the 20 word index of svr variables
c 1,2-starting loc of this eles svr sets
c 3- length of eles svr sets
c 4-11-relative starting loc for each set
c 4-structural svrs
c 5-thermal/electric/fluid svrs
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 131
Chapter 6: UPF Routines and Functions
c 6-magnetic svrs
c 7-nonlinear svrs
c 8-plasticity svrs
c 9-creep svrs
c 10-coupled svrs
c 11-user svrs
c 12-initial strain svrs
c 13-section data after FiberSIM conversion
c (shell181 only)
c 14-20 spares
*deck,svrget
subroutine svrget (svindx,nset,nsvr,svr)
c *** primary function: get svr data set for an element
c input arguments:
c svindx (int,ar(20),in) - index for svr for this element (see svgidx)
c nset (int,sc,in) - the set number in this index
c = 1 - structural svrs
c = 2 - thermal/electric/fluid svrs
c = 3 - magnetic svrs
c = 4 - nonlinear svrs
c = 5 - plasticity svrs
c = 6 - creep svrs
c = 7 - coupled svrs
c = 8 - user svrs
c = 9 - initial stress svrs
c (2,42,82,45,92,95 only)
c = 10 - section data after FiberSIM conversion
c (shell181 only)
c = 11-17 - spares (note that the first three
c items in svindx are not available)
c nsvr (int,sc,inout) - number of dp words expected in this set
c output arguments:
c nsvr (int,sc,inout) - number of dp words in this set
c svr (dp,ar(nsvr),in) - data in this set
*deck,svrput
subroutine svrput (svindx,nset,leng,svr)
c *** primary function: write out a svr data set for an element
c input arguments:
c svindx (int,ar(20),inout)- the index for svr for this element
c (see svgidx)
c nset (int,sc,in) - the set number in this index (same as svrget)
c = 1 - structural svrs
c = 2 - thermal/electric/fluid svrs
c = 3 - magnetic svrs
c = 4 - nonlinear svrs
c = 5 - plasticity svrs
c = 6 - creep svrs
c = 7 - coupled svrs
c = 8 - user svrs
c = 9 - initial stress svrs
c (2,42,82,45,92,95 only)
c = 10 - section data after FiberSIM conversion
c (shell181 only)
c = 11-17 - spares (note that the first three
c items in svindx are not available)
c leng (int,sc,in) - number of dp words in this set
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
132 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.2.6. Subroutine mreuse (Determining Which Element Matrices Can Be Reused)
c output arguments:
c svindx (int,ar(10,2),inout)- updated index
6.2.5. Subroutine svpidx (Writing the Saved Variable Element Index to a File)
*deck,svpidx
subroutine svpidx (locsvr,svindx)
c *** primary function: write the svr element index onto file
c *** secondary functions: update the locsvr pointer to next element
c input arguments:
c locsvr (LONGINT,sc,inout) - pointer to start of svr for element
c svindx (int,ar(10,2),in) - index to svr for this element
c low and high parts of 64 bit address
c output arguments:
c locsvr (LONGINT,sc,inout) - pointer to start of svr for next element
*deck,mreuse
subroutine mreuse (kelrqq,kelfil,elem,ielc,kmasrt,knlmg,kconve,
x kpheno,kprop,nprop,prop,propo,krvro,rvr,rvro,amodo,asymo, kelin)
c *** primary function:
c determine which Matrices can be REUSEd and which must be recomputed
c from iteration to iteration.
c Note: a few special elements have some supplementary logic
c to adjust these results further. No attempt as been made to
c include all such logic in these routines.
c
c Second note: this logic is essentially the same as the old
c sfrm logic. Hopefully, further simplifications and enhancements
c will be made in the future. (Especially in gap elements and in
c multilayer elements)
c the whole idea of kpheno, a holdover from the sfrm routines,
c needs to be looked at and possibly eliminated.
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c input arguments:
c kelrqq (int,ar(10),in) - request keys (needed for this analysis)
c kelfil (int,ar(10),in) - keys indicating matrices on the file
c elem (int,sc,in) - element number
c ielc (int,ar(IELCSZ),in) - array of element type characteristics
c kmasrt (int,sc,in) - does the mass matrix have rotational DOF?
c 0 - no 1 - yes(with nlgeom, sfrm1n)
c knlmg (int,sc,in) - nonlinear magnetic curve exists in this
c element
c 0 - no 1 - yes
c kconve (int,sc,in) - key indicating existence of convections
c in this element
c 0,1 - no 2 or more - yes
c must be input as 'i' if not used, as is
c changed in this routine(for analyzer).
c i = 0 must be used in calling routine
c if kpheno = 1.
c kpheno (int,sc,in) - key for type of phenomenon/level of check
c 0 - structural like old sfrm1n,1s,3n,3s,fl
c 1 - thermal like old sfrm1c,1t,2t,3t
c 2 - electrical/magnetic like some of old
c sfrmpo
c 3 - general like old sfrmoo
c kprop (int,sc,in) - key indicating which material properties
c in the prop vector that need to be
c checked (see below)
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 133
Chapter 6: UPF Routines and Functions
6.2.7. Subroutine subrd (Reading Element Load Data for a Substructure Generation Run)
*deck,subrd
subroutine subrd (iel,key,nd,vect,ka)
c *** primary function: read element load data from file for substructure
c generation run
c *** secondary functions: none
c input arguments:
c iel (int,sc,in) - element number
c key (int,sc,in) - type of load data
c = 1 temperature
c = 2 fluences
c = 3 heat generation rates
c = 4 current densities
c =10 pressures
c =11 film coefficients
c =12 bulk temperatures
c =13 extra displacement shapes
c =14 thermal strains(eptho in el42)
c =15 thermal flux (as in el55)
c =16 initial strains(epino in el01)
c =17 magnetic virtual displacements
c =18 calculated source field(hsn in el96)
c =20 element load vector
c =30 copy - do not scale(tempev in el42)
c first load step only
c nd (int,sc,in) - number of data items
c output arguments:
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
134 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.2.10. Subroutine propev (Evaluating a Group of Material Properties)
6.2.8. Subroutine subwrt (Writing an Element Load Vector to a File for a Substructure Gener-
ation Run)
*deck,subwrt
subroutine subwrt (iel,nvect,key,nd,vect,ref)
c *** primary function: write element load vect to file for substructure
c generation run
c *** secondary functions: none
c input arguments:
c iel (int,sc,in) - element number
c nvect (int,sc,in) - number of load vectors
c (current load step number)
c key (int,sc,in) - type of load vect
c = 1 temperature
c = 2 fluences
c = 3 heat generation rates
c = 4 current densities
c =10 pressures
c =11 film coefficients
c =12 bulk temperatures
c =13 extra displacement shapes
c =14 thermal strains(eptho in el42)
c =15 thermal flux (as in el55)
c =16 initial strains(epino in el01)
c =17 magnetic virtual displacements
c =18 calculated source field(hsn in el96)
c =20 element load vector
c =30 copy - do not scale(tempev in el42)
c nd (int,sc,in) - number of vect items
c vect (dp,ar(nd),in) - array of load data
c ref (dp,sc,in) - reference value for zero load
*deck,rvrget
subroutine rvrget (iel,ireal,ielc,nrvr,rvr)
c *** primary function: get the real constants for an element
c output arguments:
c nrvr (int,sc,out) - number of real variables
c rvr (dp,ar(*),out) - element real constants
*deck,propev
subroutine propev (iel,mtr,lp,tem,prop,n)
c *** primary function: to evaluate a group of material properties
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 135
Chapter 6: UPF Routines and Functions
c integer lp(3)
c data lp /1,10,13/
c call propev (elem,mat,lp(1),tem,prop(1),3)
c input arguments:
c iel (int,sc,in) - element number
c mtr (int,sc,in) - material number(input quantity mat, mat comma
c lp (int,ar(n),in) - keys for which specific value is requested
c each group must be in ascending
c order (ex,ey,ez, etc)
c if negative, a required property
c if zero, leave prop term unchanged
c ---- MP command labels --------
c EX = 1, EY = 2, EZ = 3, NUXY= 4, NUYZ= 5, NUXZ= 6, GXY = 7, GYZ = 8,
c GXZ = 9, ALPX=10, ALPY=11, ALPZ=12, DENS=13, MU =14, DAMP=15, KXX =16,
c KYY =17, KZZ =18, RSVX=19, RSVY=20, RSVZ=21, C =22, HF =23, VISC=24,
c EMIS=25, ENTH=26, LSST=27, PRXY=28, PRYZ=29, PRXZ=30, MURX=31, MURY=32,
c MURZ=33, PERX=34, PERY=35, PERZ=36, MGXX=37, MGYY=38, MGZZ=39, EGXX=40,
c EGYY=41, EGZZ=42, SBKX=43, SBKY=44, SBKZ=45, SONC=46, SLIM=47, ELIM=48,
c USR1=49, USR2=50, USR3=51, USR4=51, FLUI=53, ORTH=54, CABL=55, RIGI=56,
c HGLS=57, BM =58, QRAT=59, REFT=60, CTEX=61, CTEY=62, CTEZ=63, THSX=64,
c THSY=65, THSZ=66, DMPR=67, LSSM=68, =69, =79, =71, =72,
c =73, =74, =75, =76, =77, =78, =79, =80
c (see mpinit for uncommented code)
c (see chapter 2 of the elements volume of the user's manual
c for a detailed description))
c output arguments:
c prop (dp,ar(n),out) - values of material property
*deck,prope1
subroutine prope1 (iel,mtr,icon,tem,prop1)
c *** primary function: to evaluate one material property
c (if multiple material properties are to
c be evaluated, use propev)
c *** secondary functions: to ensure that certain required props are present
c input arguments:
c iel (int,sc,in) - element number
c mtr (int,sc,in) - material number
c icon (int,sc,in) - key for which specific value is requested
c (negative if property is required)
c ---- MP command labels --------
c EX = 1, EY = 2, EZ = 3, NUXY= 4, NUYZ= 5, NUXZ= 6, GXY = 7, GYZ = 8,
c GXZ = 9, ALPX=10, ALPY=11, ALPZ=12, DENS=13, MU =14, DAMP=15, KXX =16,
c KYY =17, KZZ =18, RSVX=19, RSVY=20, RSVZ=21, C =22, HF =23, VISC=24,
c EMIS=25, ENTH=26, LSST=27, PRXY=28, PRYZ=29, PRXZ=30, MURX=31, MURY=32,
c MURZ=33, PERX=34, PERY=35, PERZ=36, MGXX=37, MGYY=38, MGZZ=39, EGXX=40,
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
136 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.2.14. Subroutine plast1 (Updating an Element's Plastic History)
c output arguments:
c prop1 (dp,sc,out) - value of material property
*deck,pstev1
subroutine pstev1 (elem,matin,tem,prop)
c *** primary function: to evaluate material properites for 1-d elements
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c input arguments:
c elem (int,sc,in) - element number (for anserr)
c matin (int,sc,in) - material reference number
c if negative, no required properties
c tem (dp,sc,in) - temperature for evaluation
c
c output arguments:
c prop (dp,ar(5),out) - material properties: ex,nuxy,gxy,alpx,dens
c
*deck,tbuser user
subroutine tbuser (mat,numitm,tbprop)
c *** primary function: return the tb data for the user table
c input arguments:
c mat (int,sc,in) - material property number
c numitm (int,sc,in) - the number of data items requested
c output arguments:
c tbprop (dp,ar(numitm),out) - array of tb data
*deck,plast1
subroutine plast1 (option,elem,intpt,mat,kstartL,tem,dtem,e,
x ktform,dens,flu,dflu,epel,eppl,statev,usvr,
x epeq,plwork,sigepl,sigrat,et)
c *** primary function: to update the plastic history (for 1 component)
c used by: LINK1, LINK8, BEAM23, BEAM24, and
c SOLID65(reinforcing)
c *** secondary functions: to compute the material tangent matrix if requested
c input arguments:
c option (int,sc,in) - plasticity option
c elem (int,sc,in) - element number (label)
c intpt (int,sc,in) - element integration point number
c mat (int,sc,in) - material reference number
c kstartL (intL,sc,in) - virtual starting address of the data table
c tem (dp,sc,in) - temperature at the end of this substep
c dtem (dp,sc,in) - temperature increment over this substep
c e (dp,sc,in) - elastic modulus
c ktform (int,sc,in) - request key for tangent matrix formation
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 137
Chapter 6: UPF Routines and Functions
c output arguments:
c epel (dp,sc,inout) - elastic strain
c eppl (dp,sc,inout) - updated plastic strain
c statev (dp,ar(6),inout) - updated state variables
c usvr (dp,ar(*),inout) - updated user-defined state variables
c epeq (dp,sc,inout) - updated effective plastic strain
c plwork (dp,sc,inout) - updated accumulated plastic work
c sigepl (dp,sc,out) - stress value on stress-strain curve
c sigrat (dp,sc,out) - ratio of trial stress to yield stress
c et (dp,sc,out) - tangent modulus
c internal variables:
c deppl (dp,sc) - equivalent plastic strain increment
*deck,plast3
subroutine plast3 (option,elem,intpt,mat,kstartL,ncomp,tem,dtem,
x prop,d,ktform,dens,flu,dflu,epel,eppl,statev,usvr,epeq,plwork,
x sigepl,sigrat,dt,kplst,dtt,cmel)
c *** primary function: to update the plastic history (for 4 or 6 components)
c used by: PLANE02, PLANE13, PIPE20, SHELL43, SHELL51, PIPE60,
c SOLID62, SOLID65, SHELL91, SHELL93, SHELL143, SOLID191
c and by way of plast3creep : PLANE42, SOLID45, PLANE82, SOLID92, SOLID95
c input arguments:
c option (int,sc,in) -
plasticity option
c elem (int,sc,in) -
element number (label)
c intpt (int,sc,in) -
element integration point number
c mat (int,sc,in) -
material reference number
c kstartL (intL,sc,in) -
virtual starting address of the data table
c ncomp (int,sc,in) -
number of stress/strain components (4 or 6)
c tem (dp,sc,in) -
temperature at the end of this substep
c dtem (dp,sc,in) -
temperature increment over this substep
c prop (dp,ar(9),in) -
material property array (ex,ey,ez,
c gxy,gyz,gxz, uxy,uyz,uxz)
c d (dp,ar(ncomp,ncomp),in) - elastic stress-strain matrix
c ktform (int,sc,in) - request key for tangent matrix formation
c dens (dp,sc,in) - material density
c flu (dp,sc,in) - fluence at the end of this substep
c dflu (dp,sc,in) - fluence increment over this substep
c epel (dp,ar(ncomp),inout)- modified total strain (trial strain)
c eppl (dp,ar(ncomp),inout)- plastic strain at previous substep
c statev (dp,ar(ncomp,6),inout)- state variables at previous substep
c usvr (dp,ar(*),inout) - user-defined state variables (for pluser)
c epeq (dp,sc,inout) - effective plastic strain at prev substep
c plwork (dp,sc,inout) - accumulated plastic work at prev substep
c kplst (int,sc,in) - plane stress key (form dtt if kplst=1)
c output arguments:
c epel (dp,ar(ncomp),inout)- elastic strain
c eppl (dp,ar(ncomp),inout)- updated plastic strain
c statev (dp,ar(ncomp,6),inout)- updated state variables
c usvr (dp,ar(*),inout) - updated user-defined state variables
c epeq (dp,sc,inout) - updated effective plastic strain
c plwork (dp,sc,inout) - updated accumulated plastic work
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
138 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.2.17. Subroutine creep3 (Updating an Element's Creep History, 3-D Elements)
c internal variables:
c deppl (dp,sc) - equivalent plastic strain increment
*deck,creep1
subroutine creep1 (option,elem,intpt,mat,kstartL,epel,e,epcrp,
x statev,usvr,tem,dtem,fluen,dflu,sig)
c *** primary function: to update the creep history for 1-d elements
c used by: LINK1, LINK8, BEAM23, BEAM24, and
c SOLID65(reinforcing)
c input arguments:
c option (int,sc,in) - creep option
c elem (int,sc,in) - element number (label)
c intpt (int,sc,in) - element integration point number
c mat (int,sc,in) - material reference number
c kstartL (intL,sc,in) - virtual starting address of the data table
c epel (dp,sc,inout) - elastic strain
c e (dp,sc,in) - elastic modulus
c epcrp (dp,sc,inout) - creep strain at previous substep
c statev (dp,ar(7),inout) - state variables at previous substep
c usvr (dp,ar(*),inout) - user-defined state variables (for usercr)
c tem (dp,sc,in) - temperature at the end of this substep
c dtem (dp,sc,in) - temperature increment over this substep
c fluen (dp,sc,in) - fluence at the end of this substep
c dflu (dp,sc,in) - fluence increment over this substep
c epel (dp,sc,inout) - elastic strain adjusted for creep increment
c sig (dp,sc,inout) - stress (not really used)
c output arguments:
c epcrp (dp,sc,inout) - updated creep strain
c statev (dp,ar(7),inout) - updated state variables
c usvr (dp,ar(*),inout) - updated user-defined state variables
c sig (dp,sc,inout) - stress (recomputed if requested)
*deck,creep3
subroutine creep3 (option,elem,intpt,mat,kstartL,ncomp,epel,e,
x posn,d,epcrp,statev,usvr,tem,dtem,fluen,dflu,kplst,sig,hsig)
c *** primary function: to update the creep history for 3-d elements
c used by: PLANE02, PLANE13, PIPE20, PLANE42, SHELL43, SOLID45,
c SHELL51, PIPE60, SOLID62, SOLID65, PLANE82, SHELL91,
c SOLID92, SHELL93, SOLID95, SHELL143, SOLID191
c input arguments:
c option (int,sc,in) - creep option
c elem (int,sc,in) - element number (label)
c intpt (int,sc,in) - element integration point number
c mat (int,sc,in) - material reference number
c kstartL (intL,sc,in) - virtual starting address of the data table
c ncomp (int,sc,in) - number of stress/strain components (4 or 6)
c epel (dp,ar(ncomp),inout)- elastic strain
c e (dp,sc,in) - elastic young'S MODULUS
c posn (dp,sc,in) - poisson'S RATIO
c d (dp,ar(ncomp,ncomp),in) - elastic stress-strain matrix
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 139
Chapter 6: UPF Routines and Functions
c output arguments:
c epel (dp,ar(ncomp),inout)- elastic strain adjusted for creep increment
c epcrp (dp,ar(ncomp),inout)- updated creep strain
c statev (dp,ar(ncomp*5+2),inout)- updated state variables
c usvr (dp,ar(*),inout) - updated user-defined state variables
c sig (dp,ar(ncomp),inout)- stresses (redefined if c13 > 0)
c hsig (dp,sc,inout) - hydrostatic stress (redefined if c13 > 0)
*deck,swell1
subroutine swell1 (option,elem,intpt,mat,kstartL,epswel,epel,e,
x fluen,dfluen,tem,dtem,usvr)
c *** primary function: to update the swelling history for 1-d elements
c used by: LINK1, LINK8, BEAM23, and BEAM24
c input arguments:
c option (int,sc,in) - swelling option
c elem (int,sc,in) - element number (label)
c intpt (int,sc,in) - element integration point number
c mat (int,sc,in) - material reference number
c kstartL (intL,sc,in) - virtual starting address of the data table
c epswel (dp,sc,inout) - swell strain at previous substep
c epel (dp,sc,inout) - elastic strain
c e (dp,sc,in) - elastic young'S MODULUS
c fluen (dp,sc,in) - fluence at the end of this substep
c dfluen (dp,sc,in) - fluence increment over this substep
c tem (dp,sc,in) - temperature at the end of this substep
c dtem (dp,sc,in) - temperature increment over this substep
c usvr (dp,ar(*),inout) - user-defined state variables (for usersw)
c output arguments:
c epel (dp,sc,inout) - elastic strain adjusted for swelling inc
c epswel (dp,sc,inout) - updated swelling strain
c usvr (dp,ar(*),inout) - updated user-defined state variables
*deck,swell3
subroutine swell3 (option,elem,intpt,mat,kstartL,ncomp,epswel,
x epel,e,nuxy,fluen,dfluen,tem,dtem,usvr)
c *** primary function: to update the swelling history for 3-d elements
c used by: PLANE02, PLANE13, PIPE20, PLANE42, SHELL43, SOLID45,
c SHELL51, PIPE60, SOLID62, PLANE82, SHELL91, SOLID92,
c SHELL93, SOLID95, SHELL143, SOLID191
c input arguments:
c option (int,sc,in) - swelling option
c elem (int,sc,in) - element number (label)
c intpt (int,sc,in) - element integration point number
c mat (int,sc,in) - material reference number
c kstartL (intL,sc,in) - virtual starting address of the data table
c ncomp (int,sc,in) - number of stress/strain components (4 or 6)
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
140 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.2.21. Function nlget (Retrieving Material Nonlinear Property Information)
c output arguments:
c epel (dp,ar(ncomp),inout)- elastic strain adjusted for swelling inc
c epswel (dp,sc,inout) - updated swelling strain
c usvr (dp,ar(*),inout) - updated user-defined state variables
*deck,elLenPsvrBuf
function elLenPsvrBuf (mat, plOpt, ncomp)
c************************************************************************
c input arguments
c ===============
c mat (int,sc,in) - material ID
c plOpt (int,sc,in) - plasticity option
c ncomp (int,sc,in) - number of strain components (1,4, or 6)
c output arguments
c ================
c elLenPsvrBuf (int,sc,out) - number of extra data items saved
c local variables
c ===============
c************************************************************************
*deck,nlget
function nlget (mat,iprop,prop)
c *** primary function: get a material non-linear property (TB) table.
c input arguments:
c variable (typ,siz,intent) description
c mat (int,sc,in) - material number
c iprop (int,sc,in) - property number (tbpnum in tblecm)
c use 13 for tb,user
c use 14 for tb,nl
c output arguments:
c variable (typ,siz,intent) description
c nlget (int,sc,out) - number of property values
c prop (dp,ar(nlget),out) - vector of the property values
c (the first 15(tbhdsz) items are a header,
c given below. The terms are defined in
c tblecm.inc)
c --- terms of the descriptor record:
c header(1) = tbtyp
c header(2) = tbtems
c header(3) = temloc
c header(4) = dprtem
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 141
Chapter 6: UPF Routines and Functions
c header(5) = tbrow
c header(6) = tbcol
c header(7) = rowkey
c header(8) = nxtloc
c header(9) = nxttem
c header(10) = temptr
c header(11) = tbpt
c header(12) = tbsiz
c header(13) = tbopt
c header(14) = hypopt
c header(15) = tbnpts
*deck,usereo user
subroutine usereo (elem,iout,nbsvr,bsvr,nnrsvr,nrsvr,npsvr,psvr,
x ncsvr,csvr,nusvr,usvr,nnode,nodes,xyz,vol,leng,time,
x timinc,nutot,utot,maxdat,numdat,udbdat)
c
c *** primary function: to call userou, which allows user to store
c data in nmisc record
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c input arguments:
c variable (typ,siz,intent) description
c elem (int,sc,in) - element number
c iout (int,sc,in) - output unit number
c nbsvr (int,sc,in) - number of basic element variables
c bsvr (dp,ar(nbsvr),in) - basic element variables
c nnrsvr (int,sc,in) - number of nonlinear element variables
c nrsvr (dp,ar(nnrsvr),in) - nonlinear element variables
c npsvr (int,sc,in) - number of plasticity element variables
c psvr (dp,ar(npsvr),in) - plasticity element variables
c ncsvr (int,sc,in) - number of creep element variables
c csvr (dp,ar(ncsvr),in) - creep element variables
c nusvr (int,sc,in) - number of user-supplied element variables
c usvr (dp,ar(nusvr),in) - user-supplied element variables
c nnode (int,sc,in) - number of nodes
c nodes (int,ar(nnode),in) - node numbers
c xyz (dp,ar(6,nnode),in) - nodal coordinates and rotations (virgin)
c vol (dp,sc,in) - element volume (or area if 2-d)
c leng (dp,sc,in) - element length (beams,spars,etc)
c time (dp,sc,in) - current time
c timinc (dp,sc,in) - current sub step time increment
c nutot (int,sc,in) - length of dof solution vector utot
c utot (dp,ar(nutot),in) - solution vector
c maxdat (int,sc,in) - size of user output array (3 x nnode)
c actually, = ielc(nmnmup)
c
c output arguments:
c variable (typ,siz,intent) description
c numdat (int,sc,out) - number of user output items in array udbdat
c udbdat (dp,ar(maxdat),out) - user output items to be placed at the end
c of the nmisc record
c
*deck,eldwrtL
subroutine eldwrtL (ielem,edtype,lcerstL,edindxL,nval,value)
c *** primary function: output element data to result file.
c input arguments:
c ielem (int,sc,in) - element number
c edtype (int,sc,in) - element data type (see elparm)
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
142 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.2.26. Subroutine rottr (Computing the Transformation Matrix)
6.2.24. Subroutine eldwrnL (Writing Element Nonsummable Miscellaneous Data to the Results
File)
*deck,eldwrnL
subroutine eldwrnL (elem,ielc,lcerstL,edindxL,nudb,udbdat,
x nval,value,ndval)
c *** primary function: output element nonsummable miscellaneous data
c to result file
c *** Notice - This file contains ANSYS Confidential information ***
c input arguments:
c elem (int,sc,in) - element number
c ielc (int,ar(IELCSZ),in) - element characteristic vector
c defined in elccmt
c lcerstL (LONG,sc,inout) - pointer to results file position
c edindxL (LONG,ar(25),inout)- index to results file data
c nudb (in,sc,inout) - size of what the user wants to add
c udbdat (dp,ar(*),in) - what the user wants to add
c nval (int,sc,in) - the total number of values to
c be output(does not include nudb)
c this should -always- be ielc(NMNMIS),
c unless there is a variable number, as
c in the layered shell elements.
c value (dp,ar(ndval),in) - output values
c ndval (int,sc,in) - dimension of value - must be no less than
c ielc(NMNMIS) + ielc(NMNMUP)
*deck,trrot
subroutine trrot (tr,rot)
c *** primary function: get the rotation vector from a transformation matrix
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c input arguments:
c tr (dp,ar(3,3),in) - transformation matrix
c
c output arguments:
c rot (dp,ar(3),out) - rotation vector
c
*deck,rottr
subroutine rottr (rot,tr)
c primary function: compute transformation matrix from rotation vector *****
c *** Notice - This file contains ANSYS Confidential information ***
c
c ref(old): eqn. 20(transposed),rankin and brogan, jpvt,108(1986)165-174.
c ref(new): eqn. (b.4), simo and vu-quoc, cmame, 58 (1986), 79-116
c (removes singularities at pi and 2*pi)
c
c input arguments:
c variable (typ,siz,intent) description
c rot (dp,ar(4),in) - rotation parameter in radians
c
c output arguments:
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 143
Chapter 6: UPF Routines and Functions
*deck,xyzup3
subroutine xyzup3 (nnod,u,nr,xyz,nx,xyzup)
c *** primary function: update a 3-d ele nodal coords for large deformation
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c input arguments:
c nnod (int,sc,in) - number of nodes
c u (dp,ar(nr),in) - displacement vector
c nr (int,sc,in) - size of the u vector
c xyz (dp,ar(nx,nnod),in) - coordinates to be updated
c nx (int,sc,in) - row size of xy
c
c output arguments:
c xyzup (dp,ar(3,nnod),out) - updated coordinates
c
*deck,updrot
subroutine updrot (v2,w1)
c primary function: update the rotation pseudovector for 3-d large rotations *****
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c The updating of the pseudovector uses the mathematics of quarternions
c (ref: eqn. a5 of J. H. Argyris, CMAME, 32(1982)85-155). The
c pseudovector uses the nomalization proposed by Rankin and Brogan (ref:
c eqn. 15, JPVT, 108(1986)165-174).
c CMAME = Computer Methods in Applied Mechanics and Engineering
c JPVT = Journal of Presssure Vessel Technology (ASME)
c
c variable descriptions:
c input:
c v2 - rotation increment
c w1 - previous rotation pseudovector
c output:
c w1 - updated pseudovector
c
c v1 = cos(v1/2) + 1/2*w1, w1 = 2*sin(v1/2)*e1
c v2 = cos(v2/2) + 1/2*w2, w2 = 2*sin(v2/2)*e2
c v21 = v2*v1 = cos(v21/2) + 1/2*w21 (quarternion multiplication)
c w1 =: v21 (w1 is updated)
c
*deck,tmpget
subroutine tmpget (iel,ielc,nnod,nodes,ref,ndat0,begdat,dat,
x enddat,tlvf)
c primary function: define the current temperature loads
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c typ=int,dp,log,chr,dcp siz=sc,ar(n),func intent=in,out,inout
c
c input arguments:
c variable (typ,siz,intent) description
c iel (int,sc,in) - element number
c ielc (int,ar(IELCSZ),in) - array of element type characteristics
c nnod (int,sc,in) - number of nodes in the nodes array
c nodes (int,ar(nnod),in) - list of nodes
c ref (dp,sc,in) - reference temperature
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
144 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.2.31. Subroutine cnvget (Defining Current Convection Loads)
*deck,prsget
subroutine prsget (iel,ielc,nfac,ndat,begdat,dat,enddat,iexist)
c input arguments:
c iel (int,sc,in) - element number
c ielc (int,ar(IELCSZ),in) - array of element type characteristics
c nfac (int,sc,in) - number of pressure faces
c ndat (int,sc,in) - number of pressure values
c begdat (dp,ar(ndat),in) - pressure at the beginning of load step
c output arguments:
c dat (dp,ar(ndat),out) - pressures at this iteration
c enddat (dp,ar(ndat),out) - pressure at end of this load step
c iexist (int,sc,out) - flag if pressure exist
c = 0 - no pressure
c = 1 - yes pressure
*deck,cnvget
subroutine cnvget (iel,ielc,nr,u,nfac,ndat,beghc,begtb,
x hc,tb,endhc,endtb,iexist)
c primary function: define the current convection loads
c input arguments:
c iel (int,sc,in) - element number
c ielc (int,ar(IELCSZ),in) - array of element type characteristics
c nr (int,sc,in) - dimension of u (temperature) vector
c u (dp,ar(nr),in) - most current temperatures
c nfac (int,sc,in) - number of convection faces
c ndat (int,sc,in) - number of convection values
c beghc (dp,ar(ndat),in) - hcoef at the beginning of load step
c begtb (dp,ar(ndat),in) - tbulk at the beginning of load step
c output arguments:
c hc (dp,ar(ndat),out) - hcoef at this substep
c tb (dp,ar(ndat),out) - tbulk at this substep
c endhc (dp,ar(ndat),in) - hcoef at the end of this load step
c endtb (dp,ar(ndat),in) - tbulk at the end of this load step
c iexist (int,sc,out) - flag if convection exist
c = 0 - no convection
c = 1 - constant convection (with time)
c does not require new element matrix
c = 2 - changing convection (with time)
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 145
Chapter 6: UPF Routines and Functions
c or deleted convection
c requires new element matrix
*deck,hgnget
subroutine hgnget (iel,ielc,nnod,nodes,ndat,begdat,dat,enddat,
x iexist)
c primary function: define the current heat generation loads
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c typ=int,dp,log,chr,dcp siz=sc,ar(n),func intent=in,out,inout
c
c input arguments:
c variable (typ,siz,intent) description
c iel (int,sc,in) - element number
c ielc (int,ar(IELCSZ),in) - array of element type characteristics
c nnod (int,sc,in) - number of nodes in the nodes array
c nodes (int,ar(nnod),in) - list of nodes
c ndat (int,sc,in) - number of data items to get
c begdat (dp,ar(ndat),in) - data at the beginning of this load step
c
c output arguments:
c dat (dp,ar(ndat),out) - data at this time point
c enddat (dp,ar(ndat),out) - data at end of this load step
c iexist (int,sc,out) - flag if heat generation exist
c = 0 - no heat generation
c = 1 - yes heat generation
c
*deck,prinst
subroutine prinst (s)
c primary function: computes principal stresses and stress intensity
c secondary functions: none
c *** Notice - This file contains ANSYS Confidential information ***
c input arguments:
c variable (typ,siz,intent) description
c s (dp,ar(11),inout) - stress vector
c s(1)=sx
c s(2)=sy
c s(3)=sz
c s(4)=sigxy
c s(5)=sigyz
c s(6)=sigzx
c
c output arguments:
c variable (typ,siz,intent) description
c s (dp,ar(11),inout) - stress vector
c s(7)=sig1
c s(8)=sig2
c s(9)=sig3
c s(10)=s.i.
c s(11)=sige
c
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
146 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.3.1. Subroutine userfd (Computing the Complex Load Vector for Frequency Domain Logic)
6.3.1. Subroutine userfd (Computing the Complex Load Vector for Frequency Domain Logic)
*deck,userfd user
subroutine userfd (nr,kcbrm,kpfor,ktrsur,isur,
x cb,do,doext,aread,alenv,denswat,faclen,conac,fluidt,visc,
x watbas,watcur,watwav,xyzup,tr,accel,puvel,u,zass,
x forl,zsc,zsc2,pdyn,holdwv)
c *** primary function: compute complex load vector for frequency domain logic
c for pipe59
c *** secondary functions: none
c -- accessed with keyopt(12) = 2
c
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
c *** Notice - This file contains ANSYS Confidential information ***
c
c input arguments:
c nr (int,sc,in) - matrix size
c kcbrm (int,sc,in) - key for reduced matrices/cable option
c kpfor (int,sc,in) - keyopt for hydrodynamic printout
c ktrsur (int,sc,in) - keyopt for surface treatment(unfinished)
c isur (int,sc,in) - surface flag
c cb (dp,sc,in) - buoyancy coefficient (real constant)
c do (dp,sc,in) - outside diameter of pipe
c doext (dp,sc,in) - outside diameter of insulation
c aread (dp,sc,in) - area of displaced water
c alenv (dp,sc,in) - length of element
c denswat (dp,sc,in) - water density
c faclen (dp,sc,in) - wetted fraction of pipe
c conac (dp,sc,in) - added mass per unit length
c fluidt (dp,sc,in) - fluid temperature
c visc (dp,sc,in) - viscosity
c watbas (dp,ar(*),in - water basic table
c watcur (dp,ar(*),in - water current table
c watwav (dp,ar(*),in - water wave table
c xyzup (dp,ar(3,2),in) - updated coordinates
c tr (dp,ar(3,3),in) - local to global transformation matrix
c accel (dp,ar(3),in) - acceleration vector
c puvel (int,sc,in) - index for velocities in u matrix
c u (dp,ar(nr,5),in - displacements and velocities
c zass (dp,ar(nr,nr),in) - mass matrix
c forl (dp,ar(12),inout) - force vector in element coordinates
c zsc (dp,ar(nr),inout) - real load vector for frequency domain
c zsc2 (dp,ar(nr),inout) - complex load vector for frequency domain
c
c output arguments:
c forl (dp,ar(12),inout) - force vector in element coordinates
c zsc (dp,ar(nr),inout) - real load vector for frequency domain
c zsc2 (dp,ar(nr),inout) - complex load vector for frequency domain
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 147
Chapter 6: UPF Routines and Functions
*deck,userou user
subroutine userou (elem,iout,nbsvr,bsvr,nnrsvr,nrsvr,npsvr,psvr,
x ncsvr,csvr,nusvr,usvr,nnode,nodes,xyz,vol,leng,time,
x timinc,nutot,utot,maxdat,numdat,udbdat)
c
c *** primary function: store user supplied element output
c in nmisc record
c
c in order to activate this user programmable feature,
c the user must enter the usrcal command.
c
c
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
c *** Notice - This file contains ANSYS Confidential information ***
c
c this routine is called by almost every element
c the data is stored on the nmisc record.
c warning: other data may be stored between the
c documented data and this data.
c in order to see the actual information on the nmisc
c record, insert the command:
c dblist,elp,elnum1,elnum2,elinc,11
c where elnum1 = the first element
c elnum2 = the last element
c elinc = the element increment number
c after a set command in post1.
c
c input arguments:
c variable (typ,siz,intent) description
c elem (int,sc,in) - element number
c iout (int,sc,in) - output unit number
c nbsvr (int,sc,in) - number of basic element variables
c bsvr (dp,ar(nbsvr),in) - basic element variables
c nnrsvr (int,sc,in) - number of nonlinear element variables
c nrsvr (dp,ar(nnrsvr),in) - nonlinear element variables
c npsvr (int,sc,in) - number of plasticity element variables
c psvr (dp,ar(npsvr),in) - plasticity element variables
c ncsvr (int,sc,in) - number of creep element variables
c csvr (dp,ar(ncsvr),in) - creep element variables
c nusvr (int,sc,in) - number of user-supplied element variables
c (= nstv on the nsvr command)
c usvr (dp,ar(nusvr),in) - user-supplied element variables
c nnode (int,sc,in) - number of nodes
c nodes (int,ar(nnode),in) - node numbers
c xyz (dp,ar(6,nnode),in) - nodal coordinates and rotations (virgin)
c vol (dp,sc,in) - element volume (or area if 2-d)
c leng (dp,sc,in) - element length (beams,spars,etc)
c time (dp,sc,in) - current time
c timinc (dp,sc,in) - current sub step time increment
c nutot (int,sc,in) - length of dof solution vector utot
c utot (dp,ar(nutot),in) - solution vector
c maxdat (int,sc,in) - size of user output array (3 x nnode)
c
c output arguments:
c variable (typ,siz,intent) description
c numdat (int,sc,out) - number of user output items in array udbdat
c (maximum size of numdat is ielc(NMNMUP)
c which is usually three times the number
c of nodes.
c udbdat (dp,ar(maxdat),out) - user output items to be placed at the end
c of the nmisc record
c
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
148 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.3.4. Subroutine usanly (Modifying Orientation of Material Properties and Stresses of Layers)
*deck,useran user
subroutine useran (vn,vref,elem,thick,xyzctr,bsangl)
c user written routine to modify orientation of material properties
c and stresses ***************************
c applicable to: shell43,63,91,93,99, solid46,64,191
c accessed by keyopt
c
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
c *** Notice - This file contains ANSYS Confidential information ***
c
c **** warning *** do not change any arguments other than bsangl.
c if you do, your results are probably wrong.
c
c input(do not change)---
c vn = vector normal to element
c vref = unit vector orienting element, essentially edge i-j
c elem = element number
c thick = total thickness of element at this point (see note below)
c xyzctr = location of element centroid or integration point
c
c output---
c bsangl = output from this subroutine. it represents the angle(s)
c between vref and the desired orientation. it may have
c the default orientation coming in to useran.
c This will be combined with the angles derived from
c the ESYS command.
c use 1 angle for 2-d elements and shells
c use 3 angles for 3-d solids
c
6.3.4. Subroutine usanly (Modifying Orientation of Material Properties and Stresses of Layers)
*deck,usanly user
subroutine usanly (vn,vref,elem,thick,xyzctr,ln,bsangl)
c
c user written routine to modify orientation of material properties
c and stresses of layers within an element **************************
c applicable to shell91,99, and solid46,191
c accessed with keyopt(4)
c
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
c *** Notice - This file contains ANSYS Confidential information ***
c
c **** warning *** do not change any arguments other than bsangl.
c if you do, your results are probably wrong.
c input(do not change)---
c vn = vector normal to element
c vref = unit vector orienting element, essentially edge i-j
c elem = element number
c thick = thickness of layer ln at this point (see note below)
c xyzctr = location of element centroid or integration point
c ln = layer number
c
c output---
c bsangl = output from this subroutine. it represents the angle(s)
c between vref and the desired orientation of the layer.
c it may have the default orientation coming in to useran.
c
c this angle does not affect the angle given in the printout.
c users may want to add their own angle printout in usanly.
c
c also, this angle does not affect the angle shown using the
c layplot or laylist commands
c
c use 1 angle for 2-d elements and shells
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 149
Chapter 6: UPF Routines and Functions
6.3.5. Subroutine userrc (Performing User Operations on COMBIN7 and COMBIN37 Parameters)
*deck,userrc user
subroutine userrc (elem,ireal,type,nusvr,usvr,parm,parmld,
x c1,c2,c3,c4,fcon)
c primary function: user operation on parameter for combin7 and combin37
c accessed with keyopt(9) = 1
c
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
c *** Notice - This file contains ANSYS Confidential information ***
c
c input arguments:
c variable (typ,siz,intent) description
c elem (int,sc,in) - element number
c ireal (int,sc,in) - element real constant number
c type (int,sc,in) - element type number
c nusvr (int,sc,in) - number of user-supplied element variables
c usvr (dp,ar(nusvr),inout) - user-supplied element variables
c parm (dp,sc,in) - current value of the paramater
c parmld (dp,sc,in) - value of the parameter at previous time ste
c c1 (dp,sc,in) - real constant c1
c c2 (dp,sc,in) - real constant c2
c c3 (dp,sc,in) - real constant c3
c c4 (dp,sc,in) - real constant c4
c
c output arguments:
c variable (typ,siz,intent) description
c usvr (dp,ar(nusvr),inout) - user-supplied element variables
c may be sent .rst file with usereo
c fcon (dp,sc,out) - result of calculation
c
c either c1 or c3 must be nonzero for this logic to be accessed,
c
*deck,userpe user
function userpe (prs,rvrp,angle,ex,nuxy)
c input arguments:
c variable (typ,siz,intent) description
c prs (dp,ar(5),in) - pressure vector
c rvrp (dp,ar(11),in) - real constants(see elements manual)
c angle (dp,sc,in) - subtended angle
c ex (dp,sc,in) - Young's modulus
c nuxy (dp,sc,in) - Poisson's ratio
c output arguments:
c variable (typ,siz,intent) description
c userpe (dp,sc,out) - rotation caused by internal pressure on the
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
150 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.3.8. Subroutine UTHICK (Getting User-defined Initial Thickness)
c elbow element
*deck,UElMatx user
subroutine UElMatx (elem,nr,ls,zs,zsc,uelm,ielc,nodes,
x ElDofEachNode,elmdat,xyzang,lenu)
c primary function: User routine to access element matrices and load vectors.
c Needs to have USRCAL,UELMATX to be accessed.
c Called after the call to the element routine and
c before the solver.
c May be used to monitor and/or modify the element matrices
c and load vectors.
c input arguments:
c variable (typ,siz,intent) description
c elem (int,sc,in) - User element number
c nr (int,sc,in) - number of rows in element matrix
c ls (int,ar(nr),in) - Dof Index vector for this element matrix
c zs (dp,ar(nr,nr,4),inout)- K,M,C,SS matrices for this element
c zsc (dp,ar(nr,2),inout) - Element load vector and N-R correction vec
c uelm (dp,ar(nr,5),in) - Nodal displacements for this element
c ielc (int,ar(*),in) - Element type characteristics
c nodes (int,ar(*),in) - Nodes for this element
c ElDofEachNode (int,ar(nr),in) - list of dofs for each node in Global
c elmdat (int,ar(10),in) - Element data for this element
c xyzang (dp,ar(6,*),in) - X,Y,Z,THXY,THYZ,THZX for each element node
c lenu (int,sc,in) - Length of global displacement vector
c output arguments:
c zs (dp,ar(nr,nr,4),inout)- K,M,C,SS matrices for this element
c zsc (dp,ar(nr,2),inout) - Element load vector and N-R correction vec
c WARNING: any CHANGES to these (or any other) arguments will have a direc
c impact on the solution, possibly giving meaningless results. The normal
c usage of this routine is simply monitor what is happening.
*deck,uthick user
SUBROUTINE uthick (elemId, elemType, matId, realId,
$ numDomIntPts, curCoords, thickness)
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c
c *** primary function: get the user defined thickness
c
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
c
c input arguments
c ===============
c Variable (type,sz,i/o) description
c elemId (int,sc,i) element number
c elemType (int,sc,i) element TYPE (181 etc.)
c matId (int,sc,i) material number
c realId (int,sc,i) real constant set number
c numDomIntPts (int,sc,i) number of integration points
c curCoords (dp,ar(3,numDomIntPts),i)
c current coordinates
c
c output arguments
c ================
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 151
Chapter 6: UPF Routines and Functions
c thickness (dp,ar(3,numDomIntPts),o)
c thickness at the integration points
c
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c
c --- parameters
c
*deck,ustress user
SUBROUTINE ustress (elemId, elemType, matId, basis,
$ curIntPt, curLayer, curSecPt,
$ numDirect, numShear, curCoords,
$ tLocation, iniData)
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c
c *** primary function: get the user supplied stress state for
c initial stress analysis
c
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
c
c input arguments
c ===============
c Variable (type,sz,i/o) description
c elemId (int,sc,i) element number
c elemType (int,sc,i) element TYPE (42, 181 etc.)
c matId (int,sc,i) material number
c basis (dp,ar(3,3),i) basis directions (for the element)
c curIntPt (int,sc,i) current Integration point
c curLayer (int,sc,i) current Layer number (for shell
c and layered solids)
c curSecPt (int,sc,i) current point through the thickness in the
c current layer
c numDirect (int,sc,i) number of direct stress comp
c (s_xx,s_yy,s_zz)
c numShear (int,sc,i) number of shear stress comp
c (s_xy,s_yz,s_zx)
c curCoords (dp,ar(3),i) current coordinates
c tLocation (dp,sc,i) normalized thickness location
c (shell elements only)
c -1 = bottom or first sec pt
c +1 = top or last sec pt
c 0 = mid surface
c
c output arguments
c ================
c iniData (dp,ar(numDirect+numShear),o)
c user input stress values
c
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c
c --- parameters
c
*deck,UsrFictive user
subroutine UsrFictive (tref,toffst,tem,ftl, veinpt, ftc)
c *** primary function: allow users to write their own
c fictive temperature relationship
c this logic is accessed with c5 = 11 on the tb,evisc table
c *** secondary function: demonstrate the use of a user-written
c fictive temperature relationship
c this routine could also be used to modify the viscoelastic
c data during solution, i.e., to make the viscoelastic
c coefficients themselves time-dependent.
c
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
152 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.3.11. Subroutine UsrViscEl (Performs Viscoelastic Computation)
*deck,UsrViscEl user
subroutine UsrViscEl (veinpt,ncomp,tem,dtem,ex,gxy,eex,egxy,phil,
x zil,g1l,g2l,hsm,hbm,smcm,bmcm,epsl,epst,ftl,dftl,tref,tvc,dvc,
x dsig,rsig,cm,kerr,cml)
c ****** perform visco-elastic computation - stiffness pass
c
c ***** notice- this routine contains ansys, inc. confidential information ****
c
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
c
c input arguments:
c veinpt (dp,ar(95),in) - viscoelastic input data
c ncomp (int,sc,in) - number of components (4 or 6)
c tem (dp,sc,in) - temperature
c dtem (dp,sc,in) - incremental temperature
c ex (dp,sc,in) - bulk modulus at infinite time
c gxy (dp,sc,in) - shear modulus at infinite time
c smcm (dp,ar(ncomp,ncomp),in) - material matrix for shear modulus
c bmcm (dp,ar(ncomp,ncomp),in) - material matrix for bulk modulus
c epsl (dp,ar(ncomp),in) - strain for previous iteration
c epst (dp,ar(ncomp),in) - total strain for current iteration
c tref (dp,sc,in) - reference temperature
c
c output arguments:
c eex (dp,sc,out) - effective bulk modulus
c egxy (dp,sc,out) - effective shear modulus
c phil (dp,sc,inout) - previous shift factor
c zil (dp,sc,inout) - previous pseudo time
c g1l (dp,ar(ncomp,10),out) - recursive shear relaxation
c g2l (dp,ar(ncomp,10),out) - recursive bulk relaxation
c hsm (dp,ar(10),out) - recursive shear relaxation
c hbm (dp,ar(10),out) - recursive bulk relaxation
c ftl (dp,sc,inout) - previous fictive temperature
c dftl (dp,ar(10),out) - incremental fictive temperature
c tvc (dp,sc,inout) - total volume change
c dvc (dp,sc,out) - incremental volume change
c dsig (dp,ar(ncomp),out) - stress change
c rsig (dp,ar(ncomp),out) - stress relaxation
c cm (dp,ar(ncomp,ncomp),out)- total material matrix
c kerr (int,sc,out) - error key
c
c argument of convenience:
c cml (dp,ar(ncomp,ncomp),none)- no value (used only to avoid simplify
c logic due to variable array sizes)
c
c
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 153
Chapter 6: UPF Routines and Functions
6.3.12. Subroutine usrsurf116 (Modifying SURF151 and SURF152 Film Coefficients and Bulk
Temperatures)
*deck,usrsurf116 user
subroutine usrsurf116 (elem,ielc,center,jdim,kaxis,time,nr,u,
x omeg,ndat, temvel,hc,tb,key)
c *** primary function: change element convection surface info
c for surf151 and/or surf152 based on information from fluid116.
c It is called by el151 and el152.
c
c in order to activate this user programmable feature,
c the user must have used fluid116 with keyopt(2) = 1.
c Further, surf151 and/or surf152 must have keyopt(5) = 1
c (include extra node). Finally, for this routine to do anything,
c key(1) and/or key(2) must be reset in this routine to a
c nonzero number. There is no usrcal control over this routine.
c
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
c *** Notice - This file contains ANSYS Confidential information ***
c
c input arguments:
c variable (typ,siz,intent) description
c elem (int,sc,in) - element number for operation.
c ielc (int,ar(IELCSZ),in) - array of element type characteristics
c center (dp,ar(3),in) - coordinates of center of surface element
c jdim (int,sc,in) - dimensionality key
c 1 = 2d
c 2 = axisymmetric
c 3 = 3d
c kaxis (int,sc,in) - axis of rotation (keyopt(3) for el152)
c (see getv116 for definition)
c time (dp,sc,in) - time of current substep
c nr (int,sc,in) - number of nodal temperatures
c of the element
c u (dp,ar(nr),in) - vector of most recent values of the
c temperatures
c omeg (dp,sc,in) - spin real constant (may be from table)
c ndat (int,sc,in) - number of data points per element
c hc (dp,ar(ndat),inout) - film coefficients
c (has input values for each corner
c of element)
c tb (dp,ar(ndat),inout) - bulk temperature
c (has input values for each corner
c of element)
c
c output arguments:
c variable (typ,siz,intent) description
c temvel (dp,sc,out) - user defined bulk temperature in excess of
c fluid node temperature
c hc (dp,ar(ndat),inout) - film coefficients
c (defines input values for each corner
c of element)
c tb (dp,ar(ndat),inout) -bulk temperature(includes any modification)
c (defines input values for each corner
c of element)
c key (int,ar(2),out) - key if to use this logic
c key(1) = 0 = no new film coefficient
c key(1) = 1 = define new film coefficient
c key(2) = 0 = no new bulk temperature
c key(2) = 1 = define new bulk temperature
c (if key(2) = 1, the adiabatic wall
c temperature logic is not used).
c
c this routine is called during each substep of each load step.
c it is called for each equilibrium iteration.
c it is called once per element. it is called only during the heat
c flow load vector formulation stage, and not during the heat flow
c evaluation stage.
c the call to get the standard ansys input convection surfaces
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
154 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.3.14. Subroutine User116Hf (Computes the film coefficient for FLUID116)
*deck,User116Cond user
subroutine User116Cond(elem,prop,rvr,aleng,re,fric,uptot,uttot,
x bco)
c primary function: compute bc for conductance coefficient for fluid116
c input arguments:
c elem (int,sc,in) - element number
c prop (dp,ar(4),in) - material property vector
c order is: dens,visc,kxx,c
c rvr (dp,ar(24),in) - real constant vector
c aleng (dp,sc,in) - element length
c re (dp,sc,in) - reynold's number
c fric (dp,sc,in) - friction factor
c uptot (dp,ar(2),in - nodal pressure values from previous iteration
c uttot (dp,ar(4),in - nodal temperature values from prev iteration
c bco (dp,sc,inout) - the conductance coefficient from TB,fcon
c output arguments:
c bco (dp,sc,inout) - the desired conductance coefficient
*deck,User116Hf user
subroutine User116Hf (elem,prop,rvr,aleng,re,uptot,uttot,hf)
c primary function: compute hf for film coefficient for fluid116
c input arguments:
c elem (int,sc,in) - element number
c prop (dp,ar(4),inout) - material property vector
c order is: dens,visc,kxx,c
c rvr (dp,ar(18),in) - real constant vector
c aleng (dp,sc,in) - element length
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 155
Chapter 6: UPF Routines and Functions
c output arguments:
c hf (dp,sc,inout) - the desired film coefficient
*deck,Us_Surf_Str user
subroutine Us_Surf_Str (elem,face,area,temp,pressure,ep,stress)
c *** primary function: User routine to capture surface stresses
c called by PLANE2, 42, 82 and SOLID45, 92, 95
c input arguments:
c variable (typ,siz,intent) description
c elem (int,sc,in) element number
c face (int,sc,in) face number
c area (dp, sc,in) face area (or length)
c temp (dp, sc,in) face temperature
c pressure(dp, sc,in) face pressure
c ep (dp,ar(4),in) face strains
c stress (dp,ar(11),in) face stresses
6.3.16. Subroutine usflex (Computes the flexibility factor for PIPE16, PIPE17, PIPE18, and
PIPE60)
*deck,usflex user
subroutine usflex (etype,elem,rvrm,kff,prs,ex, flexi,flexo)
c *** primary function: to (re)compute the flexibility factor
c for pipe16, pipe17, pipe18, and pipe60
c this is accessed by inputting the flexibility factor
c as any negative number.
c *** secondary functions: none
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
c
c typ=int,dp,log,chr,dcp siz=sc,ar(n) intent=in,out,inout
c
c input arguments:
c variable (typ,siz,intent) description
c etype (int,sc,in) - pipe element type (16, 17, 18 or 60)
c elem (int,sc,in) - element number
c rvrm (dp,ar(*),in) - real constants
c kff (int,sc,in) - keyopt for flexibility factor
c (not used for pipe16 or pipe17)
c prs (dp,ar(5),in) - pressures
c ex (dp,sc,in) - young's Modulus
c flexi (dp,sc,inout) - effective in-plane flexibility factor
c flexo (dp,sc,inout) - effective out-of-plane flexibility factor
c (not used for pipe16 or pipe17)
c
c output arguments:
c variable (typ,siz,intent) description
c flexi (dp,sc,inout) - effective in-plane flexibility factor
c flexo (dp,sc,inout) - effective out-of-plane flexibility factor
c (not used for pipe16 or pipe17)
c
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
156 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.4.1. Subroutine usermat (Writing Your Own Material Models)
*deck, user
subroutine UsrShift(dxi,dxihalf,timinc,
& temp,dtemp,toffst,propsh,nTerms)
c********************************************************************************
c calculate pseudotime time increment according
c to a user specified shift function
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c input arguments:
c timinc (dp,sc,in) - time increment
c temp (dp,sc,in) - current temperature, t_n+1
c dtemp (dp,sc,in) - temperature increment, t_n+1 - t_n
c toffst (dp,sc,in) - temperature offset to absolute zero
c (specified by TOFFST command)
c propsh (dp,ar,in) - Constants for shift function
c (User's input using TB,SHIFT,,,,USER)
c nTerms (int,ar,in) - number of user defined constants
c (specified in TB,SHIFT,,,nTerms,USER)
c output arguments:
c dxi (dp,sc,out) - pseudotime increment
c dxihalf (dp,sc,out) - pseudotime increment over the upper half span
c********************************************************************************
Note
If you write a material behavior routine using any of the ANSYS commands MPDATA, MPDELE, TB,
or TBDELE, be aware that these commands interpret the string "_MATL" to mean the current active
material when it appears in their MAT field.The "_MATL" is used in conjunction with the library (LIB)
option of the MPREAD and MPWRITE commands. MPWRITE inserts "_MATL" in lieu of the specified
material number as these commands are written to the material library file.This occurs only when
you use the LIB option. When ANSYS reads a material library file written in this format, it interprets
"_MATL" to mean the currently active material (as defined by the MAT,MAT command). Do not use
the "_MATL" string outside the scope of the MPREAD command.
*deck,usermat user
subroutine usermat(
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 157
Chapter 6: UPF Routines and Functions
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
158 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.4.1. Subroutine usermat (Writing Your Own Material Models)
c
c input output arguments
c ======================
c stress (dp,ar(nTesn),io) stress
c ustatev (dp,ar(nstatev),io) user state variables
c sedEl (dp,sc,io) elastic work
c sedPl (dp,sc,io) plastic work
c epseq (dp,sc,io) equivalent plastic strain
c tsstif (dp,ar(2),io) transverse shear stiffness
c tsstif(1) - Gxz
c tsstif(2) - Gyz
c tsstif(1) is also used to calculate hourglass
c stiffness, this value must be defined when low
c order element, such as 181, 182, 185 with uniform
c integration is used.
c var? (dp,sc,io) not used, they are reserved arguments
c for further development
c
c output arguments
c ================
c keycut (int,sc,io) loading bisect/cut control
c 0 - no bisect/cut
c 1 - bisect/cut
c (factor will be determined by ANSYS solution control)
c dsdePl (dp,ar(ncomp,ncomp),io) material jacobian matrix
c epsZZ (dp,sc,o) strain epsZZ for plane stress,
c define it when accounting for thickness change
c in shell and plane stress states
c
c*************************************************************************
c
c ncomp 6 for 3D (nshear=3)
c ncomp 4 for plane strain or axisymmetric (nShear = 1)
c ncomp 3 for plane stress (nShear = 1)
c ncomp 3 for 3d beam (nShear = 2)
c ncomp 1 for 1D (nShear = 0)
c
c stresss and strains, plastic strain vectors
c 11, 22, 33, 12, 23, 13 for 3D
c 11, 22, 33, 12 for plane strain or axisymmetry
c 11, 22, 12 for plane stress
c 11, 13, 12 for 3d beam
c 11 for 1D
c
c material jacobian matrix
c 3D
c dsdePl | 1111 1122 1133 1112 1123 1113 |
c dsdePl | 2211 2222 2233 2212 2223 2213 |
c dsdePl | 3311 3322 3333 3312 3323 3313 |
c dsdePl | 1211 1222 1233 1212 1223 1213 |
c dsdePl | 2311 2322 2333 2312 2323 2313 |
c dsdePl | 1311 1322 1333 1312 1323 1313 |
c plane strain or axisymmetric (11, 22, 33, 12)
c dsdePl | 1111 1122 1133 1112 |
c dsdePl | 2211 2222 2233 2212 |
c dsdePl | 3311 3322 3333 3312 |
c dsdePl | 1211 1222 1233 1212 |
c plane stress (11, 22, 12)
c dsdePl | 1111 1122 1112 |
c dsdePl | 2211 2222 2212 |
c dsdePl | 1211 1222 1212 |
c 3d beam (11, 13, 12)
c dsdePl | 1111 1113 1112 |
c dsdePl | 1311 1313 1312 |
c dsdePl | 1211 1213 1212 |
c 1d
c dsdePl | 1111 |
c
c*************************************************************************
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 159
Chapter 6: UPF Routines and Functions
*deck,userpl user
subroutine userpl (elem,intpt,mat,ncomp,kfirst,kfsteq,e,nu,dens,
x prop,d,ktform,timval,timinc,tem,dtem,toffst,flu,dflu,epel,eppl,
x statev,usvr,epeq,plwork,sigepl,sigrat,depeq,dt)
c
c *** primary function: allow users to write their own plasticity laws.
c this logic is accessed with tb,user.
c the below demonstration logic is the same as using
c tb,bkin, without adaptive descent (nropt,,,off).
c Other plasticity rules may require internal
c iterations and/or the more general definition of
c plasticity theory, discussed in the Theory
c Manual.
c *** secondary function: demonstrate the use of user-written plasticity laws
c in this routine:
c a. update the nonlinear strain history
c b. compute the material tangent matrix if requested
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c
c *** ansys(r) copyright(c) 2004
c *** ansys, inc.
c
c input arguments:
c variable (type,sze,intent) description
c
c elem (int,sc,in) - element number (label)
c intpt (int,sc,in) - element integration point number
c mat (int,sc,in) - material reference number
c ncomp (int,sc,in) - no. of stress/strain components (1,4 or 6)
c 1 - x
c 4 - x,y,z,xy
c 6 - x,y,z,xy,yz,xz
c kfirst (int,sc,in) - 1 if first time through, 0 otherwise
c (useful for initializing state variables
c to a non-zero value)
c kfsteq (int,sc,in) - 1 if first equilibrium iteration of a
c substep, 0 otherwise
c
c e (dp,sc,in) - average elastic modulus
c nu (dp,sc,in) - average poisson ratio
c dens (dp,sc,in) - current material density (mass/volume)
c prop - linear material property array
c (dp,ar(9),in) (ex,ey,ez, gxy,gyz,gxz, nuxy,nuyz,nuxz)
c (dp,ar(1),in) if ncomp=1 (ex)
c d (dp,ar(ncomp,ncomp),in)- elastic stress-strain matrix
c ktform (int,sc,in) - request key for tangent matrix formation
c (=1, form tangent .ne.1, do not form)
c
c timval (dp,sc,in) - current time value
c timinc (dp,sc,in) - time increment over this substep
c
c tem (dp,sc,in) - temperature at the end of this substep
c dtem (dp,sc,in) - temperature increment over this substep
c toffst (dp,sc,in) - temperature offset from absolute zero
c flu (dp,sc,in) - fluence at the end of this substep
c dflu (dp,sc,in) - fluence increment over this substep
c
c epel (dp,ar(ncomp),inout)- modified total strain (trial strain)
c epel = eptot - eppl - eptherm - ...
c if a large strain analysis, epel is
c rotation neutralized and is the hencky
c (i.e. log) strain
c eppl (dp,ar(ncomp),inout)- plastic strain from previous substep
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
160 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.4.3. Subroutines usercreep and usercr (Defining Viscoplastic/Creep Material Behavior)
c
c statev (dp,ar(ncomp,6),inout)- state variables from previous substep
c usvr (dp,ar(nuval,nintp),inout)- additional state variables from
c previous equilibrium iteration (saved
c if the nsvr command is used)
c
c epeq (dp,sc,inout) - effective plastic strain from prev substep
c plwork (dp,sc,inout) - accumulated plastic work from prev substep
c
c output arguments:
c variable (type,sze,intent) description
c
c epel (dp,ar(ncomp),inout)- elastic strain
c eppl (dp,ar(ncomp),inout)- updated plastic strain
c
c statev (dp,ar(ncomp,6),inout)- updated state variables
c usvr (dp,ar(nuval,nintp),inout)- updated additional state variables
c
c epeq (dp,sc,inout) - updated effective plastic strain
c plwork (dp,sc,inout) - updated accumulated plastic work
c
c sigepl (dp,sc,out) - stress value on stress-strain curve at epeq
c sigrat (dp,sc,out) - ratio of trial stress to yield stress
c depeq (dp,sc,out) - increment in plastic strain (equivalent)
c (used for auto time stepping - time step
c is reduced if it exceeds .05)
c
c dt (dp,ar(ncomp,ncomp),out)- material tangent modulus
c
c fortran parameters (to be defined by the user):
c variable (type) description
c numinp (int) - number of data items in the user-defined
c data table (tbdat commands)
c nuval (int) - number of additional state variables per
c integration point
c nintp (int) - maximum number of integration points of
c an element to be used with this routine
c (14 is the maximum)
c note: nuval x nintp = nstv(on nsvr command); cannot exceed 840!
c
c internal variables:
c variable (type,sze) description
c b (dp,ar(6,6)) - 2nd derivative of the yield function
c c (dp,ar(6,12)) - part of deff
c con (dp,sc) - temporary variable
c deppl (dp,ar(6)) - plastic strain increment
c dfds (dp,ar(6)) - derivative of the yield function (normal)
c dlamb (dp,sc) - plastic multiplier
c ep (dp,ar(6)) - shifted strain
c epshfo (dp,ar(6)) - initial shift strain (center of the yield surf)
c epshft (dp,ar(6)) - shift strain (center of the yield surface)
c et (dp,sc) - tangent modulus (stress/total strain)
c h (dp,sc) - plastic tangent modulus (stress/plastic strain)
c n2 (int,sc) - ncomp squared, ncomp*ncomp
c seqtr (dp,sc) - equivalent (von mises) trial stress
c sigtr (dp,ar(6)) - trial stress
c sigy (dp,sc) - yield stress
c vect (dp,ar(6)) - temporary vector
c
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 161
Chapter 6: UPF Routines and Functions
as transient analyses with very small time increments, or when the creep behavior of materials is not that signi-
ficant. In the finite deformation analysis, you should interpret the strain variables in the subroutines as logarithmic
strains, and you should interpret the stresses as true stresses.
Use the subroutine usercreep to define viscoplastic/creep behavior of materials when you issue the TB com-
mand with the CREEP option, and with TBOPT = 100.The subroutine will be called at all integration points of
elements for which the material is defined by this command. ANSYS always uses implicit time integration for
this creep option.You can use plasticity options (BISO, MISO, NLISO) to define the plastic behavior of materials.
Creep and plastic strain will be calculated simultaneously when both creep and plasticity are defined for a ma-
terial.Through this subroutine, you can specify a "uniaxial" creep law that will be generalized to the multi-axial
state by the general time-dependent viscoplastic material formulation implemented in ANSYS.You can use and
update internal state variables in the subroutine.The number of state variables has to be defined by TB,STATE.
*deck,usercreep user
SUBROUTINE usercreep (impflg, ldstep, isubst, matId , elemId,
& kDInPt, kLayer, kSecPt, nstatv, nprop,
& prop , time , dtime , temp , dtemp ,
& toffst, Ustatev, creqv , pres , seqv ,
& delcr , dcrda)
c*************************************************************************
c *** primary function ***
c Define creep laws when creep table options are
c TB,CREEP with TBOPT=100.
c Demonstrate how to implement usercreep subroutine
c
c Creep equation is
c dotcreq := k0 * seqv ^ n * creqv ^ m * exp (-b/T)
c
c seqv is equivalent effective stress (Von-Mises stress)
c creqv is equivalent effective creep strain
c T is the temperature
c k0, m, n, b are materials constants,
c
c This model corresponds to primary creep function TBOPT = 1
c
c gal 10.01.1998
c
c*************************************************************************
c
c input arguments
c ===============
c impflg (in ,sc ,i) Explicit/implicit integration
c flag (currently not used)
c ldstep (in ,sc ,i) Current load step
c isubst (in ,sc ,i) Current sub step
c matId (in ,sc ,i) number of material index
c elemId (in ,sc ,i) Element number
c kDInPt (in ,sc ,i) Material integration point
c kLayer (in ,sc ,i) Layer number
c kSecPt (in ,sc ,i) Section point
c nstatv (in ,sc ,i) Number of state variables
c nprop (in ,sc ,i) size of mat properties array
c
c prop (dp ,ar(*),i) mat properties array
c This array is passed all the creep
c constants defined by command
c TBDATA associated with TB,CREEP
c (do not use prop(13), as it is used
c elsewhere)
c at temperature temp.
c time Current time
c dtime Current time increment
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
162 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.4.3. Subroutines usercreep and usercr (Defining Viscoplastic/Creep Material Behavior)
In contrast to the usercreep subroutine, for the usercr subroutine, you need to specify the creep strain
tensor. A detailed explanation of this subroutine follows.
*deck,usercr user
subroutine usercr (elem,intpt,mat,ncomp,kfirst,kfsteq,e,posn,d,
x proptb,timval,timinc,tem,dtem,toffst,fluen,dfluen,epel,epcrp,
x statev,usvr,delcr)
c
c *** primary function: allow users to write their own creep laws.
c this logic is accessed with c6 = 100
c *** secondary function: demonstrate the use of user-written creep laws
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
c
c input arguments:
c variable (type,sze,intent) description
c
c elem (int,sc,in) - element number (label)
c intpt (int,sc,in) - element integration point number
c mat (int,sc,in) - material reference number
c ncomp (int,sc,in) - no. of stress/strain components (1,4 or 6)
c 1 - x
c 4 - x,y,z,xy
c 6 - x,y,z,xy,yz,xz
c kfirst (int,sc,in) - 1 if first time through, 0 otherwise
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 163
Chapter 6: UPF Routines and Functions
*deck,usersw user
subroutine usersw (option,elem,intpt,mat,proptb,ncomp,epswel,
x epel,e,nuxy,fluen,dfluen,tem,dtem,toffst,timvll,timvnc,usvr)
c
c *** primary function: allow users to write their own swelling laws.
c this logic is accessed with c72 = 10
c *** secondary function: demonstrate the use of user-written swelling laws
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
164 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.4.5. Subroutine UserHyper (Writing Your Own Hyperelasticity Laws)
c
c
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
c *** Notice - This file contains ANSYS Confidential information ***
c
c input arguments:
c option (int,sc,in) swelling option
c elem (int,sc,in) element number (label)
c intpt (int,sc,in) element integration point number
c mat (int,sc,in) material reference number
c proptb (dp,ar(*),in) nonlinear material table (tb commands)
c ncomp (int,sc,in) number of strain components (=1, 4, or 6)
c 1 - truss or beam elements
c 4 - 2-d solids and pipe elements
c 6 - 3-d solids and most shells
c epswel (dp,sc,inout) total accumulated swelling strain
c before this substep
c epel (dp,ar(ncomp),inout) elastic strain
c e (dp,sc,in) elastic modulus
c nuxy (dp,sc,in) poisson'S RATIO
c fluen (dp,sc,in) total fluence (bf or bfe commands)
c dfluen (dp,sc,in) increment in fluence for this substep
c tem (dp,sc,in) temperature (bf or bfe commands)
c dtem (dp,sc,in) increment in temperature for this substep
c toffst (dp,sc,in) offset of temperature scale from absolute zero
c (toffst command)
c timvll (dp,sc,in) time at the end of this substep
c timvnc (dp,sc,in) the increment of time this substep
c usvr (dp,ar(*),inout) user-defined state variables(optional)
c
c output arguments:
c epswel (dp,sc,inout) total accumulated swelling strain
c after this substep
c epel (dp,ar(ncomp),inout) elastic strain adjusted
c for swelling increment
c usvr (dp,ar(*),inout) updated user-defined state variables
c
*deck,UserHyper user
subroutine UserHyper(
& prophy, incomp, nprophy, invar,
& potential, pInvDer)
c************************************************************************
c
c *** Example of user hyperelastic routine
c
c This example uses Arruda hyperelasticity model
c which is the same ANSYS TB,BOYCE
c
c input arguments
c ===============
c prophy (dp,ar(*),i) material property array
c nprophy (int,sc,i) # of material constants
c invar dp,ar(3) invariants
c
c output arguments
c ================
c incomp (log,sc,i) fully incompressible or compressible
c potential dp,sc value of potential
c pInvDer dp,ar(10) der of potential wrt i1,i2,j
c 1 - der of potential wrt i1
c 2 - der of potential wrt i2
c 3 - der of potential wrt i1i1
c 4 - der of potential wrt i1i2
c 5 - der of potential wrt i2i2
c 6 - der of potential wrt i1j
c 7 - der of potential wrt i2j
c 8 - der of potential wrt j
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 165
Chapter 6: UPF Routines and Functions
*deck,uservp user
subroutine uservp (elem,mat,kfirst,kfsteq,g,prop,timval,timinc,
x tem,toffst,delepn,svrn,svri,usvr,epeln,epeli,strn,stri,depdt,
x cee,eta,norm)
c
c *** primary function: update the nonlinear strain history for a
c user-defined material for the viscoxxx elements
c *** secondary functions: compute the material tangent terms
c accessed with tb,user and keyopt(1) = 1
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
c
c input arguments:
c variable (type,sze,intent) description
c
c elem (int,sc,in) - element number (label)
c mat (int,sc,in) - material reference number
c kfirst (int,sc,in) - 1 if first time through, 0 otherwise
c (useful for initializing state variables
c to a non-zero value)
c kfsteq (int,sc,in) - 1 if first equilibrium iteration of a
c substep, 0 otherwise
c
c g (dp,sc,in) - shear modulus
c prop (dp,ar(13),in) - linear material property array
c (ex,ey,ez, gxy,gyz,gxz, nuxy,nuyz,nuxz,
c alpx,alpy,alpz, dens)
c
c timval (dp,sc,in) - current time value
c timinc (dp,sc,in) - time increment over this substep
c
c tem (dp,sc,in) - temperature at the end of this substep
c toffst (dp,sc,in) - temperature offset from absolute zero
c
c delepn (dp,ar(3,3),in) - hencky strain increment over the substep
c
c svrn (dp,sc,in) - state variable from previous substep
c svri (dp,sc,inout) - state variable from previous iteration
c usvr (dp,ar(*),inout) - additional state variables from previous
c iteration (saved if the nsvr command is
c used)
c
c epeln (dp,ar(3,3),in) - elastic strain from previous substep
c epeli (dp,ar(3,3),inout) - elastic strain from previous iteration
c
c strn (dp,ar(3,3),in) - stress from previous substep
c stri (dp,ar(3,3),inout) - stress from previous iteration
c
c depdt (dp,sc,inout) - effective inelastic deformation rate
c (d(deppl)/dt) from previous iteration
c
c output arguments:
c variable (type,sze,intent) description
c
c svri (dp,sc,inout) - updated state variable
c usvr (dp,ar(*),inout) - updated additional state variables
c
c epeli (dp,ar(3,3),inout) - updated elastic strain
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
166 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.4.8. Subroutine usermc (Controlling Hygrothermal Growth)
*deck,userck user
subroutine userck (curmat,ntb,tb)
c *** primary function: check the user-defined material data,
c input with the TB,user command.
c *** secondary functions: none
c
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
c *** Notice - This file contains ANSYS Confidential information ***
c
c input arguments:
c curmat (int,sc,in) - current material number
c ntb (int,sc,in) - dimension of tb
c tb (dp,ar(ntb),in) - input table
c
c output arguments:
c none
c
*deck,usermc user
subroutine usermc (elem,time,msci,dmsci,mscr,mscra)
c *** primary function: user control of hygrothermal growth
c *** secondary functions: none
c presently, called only by shell91
c
c in order to activate this user programmable feature,
c the user must enter the usrcal command.
c
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
c *** Notice - This file contains ANSYS Confidential information ***
c
c input arguments:
c elem (int,sc,in) - element number
c time (dp,sc,in) - time
c msci (dp,sc,in) - moisture content
c dmsci (dp,sc,in) - change of moisture content
c mscr (dp,ar(3),in) - input material properties for growth
c
c output arguments:
c mscra (dp,ar(3),out) - output material properties for growth
c
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 167
Chapter 6: UPF Routines and Functions
*deck,usrfc6 user
subroutine usrfc6 (elem,matlay,iott,keyer,tem,elim,slim,
x eps, sig, fc6)
c primary function: user subroutine for defining your own failure criterion
c *** secondary functions: none
c --- accessed with c6 = -1
c *** user programmable functions may not be used in parallel processing ***
c this is currently only available with
c
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c input arguments:
c variable (typ,siz,intent) description
c elem (int,sc,in) - element number
c elim (dp,ar(9),in) - failure strains at the current temperature
c (tbdata items 1-9)
c slim (dp,ar(12),in) - failure stresses and coupling coefficients
c at the current temperature
c (tbdata items 10-21)
c eps (dp,ar(6),in) - vector of strains
c sig (dp,ar(6),in) - vector of stresses
c tem (dp,sc,in) - temperature at this point in the model
c matlay (int,sc,in) - material number
c iott (int,sc,in) - unit number for writing
c keyer (int,sc,inout) - error flag (0 = ok, 1 = error or routine not defined)
c
c output arguments:
c variable (typ,siz,intent) description
c keyer (int,sc,inout) - error flag (0 = ok, 1 = error or routine not defined)
c fc6 (dp,sc,out) - failure criterion to be processed by solid46,
c shell91, shell99, or solid191
c
*deck,UserVisLaw user
subroutine UserVisLaw
x (dudx,dudy,dudz,
x dvdx,dvdy,dvdz,
x dwdx,dwdy,dwdz,
x u,v,w,x,y,z,kGeom,
x Vis,Temp,Tref,Pres,Pref,Cf,
x MFrac,DfNSpec,Time,VisNew,toffst)
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
168 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.4.12. Supporting Function egen
*deck,egen
function egen (kcomp,ep,posn)
c primary function: combines strain components to give an "overall" strain
c used in creep and plasticity calculations
c secondary functions: none
c ___________________________________________________________________
c /1 2 2 2 1 2 2 2
c \ / -*((ep - ep ) + (ep - ep ) + (ep - ep ) + -*(ep + ep + ep ))
c \/ 2 1 2 2 3 3 1 2 4 5 6
c ------------------------------------------------------------------------
c (1 + posn)
c input arguments:
c variable (typ,siz,intent) description
c kcomp (int,sc,in) - number of components of strain
c ep (dp,ar(6),in) - the strain components
c posn (dp,sc,in) - poisson's ratio
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 169
Chapter 6: UPF Routines and Functions
c output arguments:
c egen (dp,func,out) - the combined strain value
c
Setting custom values for scalar fields (temperatures, heat fluxes, etc.)
Changing element pressure information
Changing information about element face convection surfaces
Changing information about element face heat flux surfaces
Changing information about element face charge density surfaces
Changing information about element acceleration/angular velocity.
Activate these routines by issuing the USRCAL command or by choosing an equivalent menu path.
*deck,usrefl user
subroutine usrefl (key,iel,ielc,nnod,nodes,time,defalt,nd,dat)
c *** primary function: change the scalar fields (temperatures, fluences,
c heat generation, etc.) to what user desires.
c *** secondary functions: none
c
c in order to activate this user programmable feature,
c the user must enter the usrcal command.
c
c this routine is called at each substep of each load step
c for which element or nodal temperatures(etc) are used.
c it is called for each equilibrium iteration.
c the call to get the standard ansys input element or nodal values
c is made just before entering this routine.
c
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c typ=int,dp,log,chr,dcp siz=sc,ar(n) intent=in,out,inout
c
c input arguments:
c variable (typ,siz,intent) description
c key (int,sc,in) - type of data desired
c = 1 temperatures
c = 2 fluences
c = 3 heat generation rates
c = 4 moisture contents
c = 5 magnetic virtual displacements
c iel (int,sc,in) - element number
c ielc (int,ar(IELCSZ),in) - array of element type characteristics
c nnod (int,sc,in) - number of nodes
c nodes (int,ar(nnod),in) - list of nodes
c time (dp,sc,in) - time of current substep
c defalt (dp,sc,in) - default value (e.g. tunif)
c nd (int,sc,in) - size of dat array
c dat (dp,ar(nd),inout) - array of data as normally computed by element
c as selected by key
c
c output arguments:
c variable (typ,siz,intent) description
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
170 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.5.3. Subroutine usercv (Changing Element Face Convection Surface Information)
*deck,userpr user
subroutine userpr (ielc,elem,time,ndat,dat)
c *** primary function: change element pressure information.
c this routine is called at each substep of each load step for which
c pressures are used. it is called for each equilibrium iteration.
c it is called once per element.
c the call to get the standard ansys input pressures is made just before
c entering this routine.
c input arguments:
c variable (typ,siz,intent) description
c ielc (int,ar(IELCSZ),in) - array of element type characteristics
c elem (int,sc,in) - element number for operation.
c time (dp,sc,in) - time of current substep
c ndat (int,sc,in) - number of pressure items for this element
c dat (dp,ar(ndat,2),inout) - the element pressure vector
c (has input values for each corner
c of each face)
c output arguments:
c variable (typ,siz,intent) description
c dat (dp,ar(ndat,2),inout) - the element pressure vector
c (defines input values for each corner
c of each face)
c dat(1:ndat,1) - real pressures
c dat(1:ndat,2) - complex pressures
c (surface elements only)
*deck,usercv user
subroutine usercv (elem,ielc,time,nr,u, ndat,hc,tb)
c *** primary function: change element face convection surface info
c
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
c
c in order to activate this user programmable feature,
c the user must enter the 'usrcal,usercv' command.
c
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 171
Chapter 6: UPF Routines and Functions
c
c input arguments:
c variable (typ,siz,intent) description
c elem (int,sc,in) - element number for operation.
c ielc (int,ar(IELCSZ),in) - array of element type characteristics
c time (dp,sc,in) - time of current substep
c nr (int,sc,in) - number of nodal temperatures
c of the element
c u (dp,ar(nr),in) - vector of most recent values of the
c temperatures
c ndat (int,sc,in) - number of data points per element
c for example, for solid70, ndat = 24 = 6*4
c where 6 = faces per element
c 4 = corners per face
c hc (dp,ar(ndat),inout) - film coefficients
c (has input values for each corner
c of each face)
c tb (dp,ar(ndat),inout) - bulk temperature
c (has input values for each corner
c of each face)
c
c output arguments:
c variable (typ,siz,intent) description
c hc (dp,ar(ndat),inout) - film coefficients
c (defines input values for each corner
c of each face)
c tb (dp,ar(ndat),inout) - bulk temperature
c (defines input values for each corner
c of each face)
c
6.5.4. Subroutine userfx (Changing Element Face Heat Flux Surface Information)
*deck,userfx user
subroutine userfx (ielc,elem,time,nr,u, ndat,dat)
c *** primary function: change element face heat flux surface info
c
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
c
c in order to activate this user programmable feature,
c the user must enter the 'usrcal,userfx' command.
c
c this routine is called during each substep of each load step.
c it is called for each equilibrium iteration.
c it is called once per element. it is called only during the heat
c flow load vector formulation stage, and not during the heat flow
c evaluation stage.
c the call to get the standard ansys input heat flux surfaces
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
172 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.5.5. Subroutine userch (Changing Element Face Charge Density Surface Information)
c
c output arguments:
c variable (typ,siz,intent) description
c dat (dp,ar(ndat),inout) - fluxes
c (defines input values for each corner
c of each face)
c
6.5.5. Subroutine userch (Changing Element Face Charge Density Surface Information)
*deck,userch user
subroutine userch (ielc,ielem,time,nr,u, ndat,dat)
c *** primary function: change element face charge density surface info
c
c in order to activate this user programmable feature,
c the user must enter the usrcal command.
c
c this routine is called during each substep of each load step.
c it is called once per element. it is called only during the heat
c flow load vector formulation stage, and not during the heat flow
c evaluation stage.
c the call to get the standard ansys input charge densities of surfaces
c is made just before entering this routine, so this information is
c available to be modified, if desired.
c
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
c
c input arguments:
c variable (typ,siz,intent) description
c ielc (int,ar(IELCSZ),in) - array of element type characteristics
c ielem (int,sc,in) - element number for operation.
c time (dp,sc,in) - time of current substep
c nr (int,sc,in) - number of nodal temperatures
c of the element
c u (dp,ar(nr),in) - vector of most recent values of the
c temperatures
c ndat (int,sc,in) - number of data points per element
c dat (dp,ar(ndat),inout) - fluxes
c
c output arguments:
c variable (typ,siz,intent) description
c dat (dp,ar(ndat),inout) - fluxes
c
c the input argument dat may be used in one of three ways:
c 1. they may be simply passed thru.
c 2. they may be used as a flag(e.g. if dat(2) = -3.0, use
c a certain set of logic).
c 3. they may be completely ignored.
c and instead redefined with new logic
c
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 173
Chapter 6: UPF Routines and Functions
If you are running ANSYS on a UNIX system (but not under Windows), you also can call the ANSYS program as a
subroutine in a program you've written.To do so, use the following:
subroutine ansys
For multiple calls to subroutine ANSYS, you must open and close standard input in the calling routine. (Usually,
input and output are FORTRAN units 5 and 6, respectively.) The calling routine can't use the database access
routines. But, other user programmable features can use the database access routines freely.
There may be times when ANSYS exits abnormally. Check the file.err file to see if ANSYS wrote an exit code
to the file before ending.These error codes may help you to understand the problem ANSYS had:
1. Insert the code for the functions you want to perform into routine user01 (or user02, etc.).
2. Link the routine into the ANSYS program.
3. Issue the ANSYS command /UCMD to define a name for a custom command that calls and executes your
routine. Use the command format shown below:
/UCMD,Cmd,SRNUM
Cmd
The name for your new command. It can contain any number of characters, but only the first four are signi-
ficant.The name you specify can not conflict with the name of any ANSYS command or the names of any
other commands or macros.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
174 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.7.1. Function user01
SRNUM
The number of the routine your command should call; that is, a value between 01 and 10. For example,
suppose that you create and link in a user routine for a parabolic distribution of pressure, and you name that
routine user01. Issuing the command shown below creates a new command, PARB, that when issued calls
your parabolic pressure distribution routine:
/UCMD,PARB,1
To make these "custom command" routines available in all your ANSYS sessions, include the /UCMD commands
in your start-up file (START.ANS).
You also can use /UCMD to remove a custom command.To do so, simply use a blank value for Cmd, as shown
below:
/UCMD,,1
This command removes the PARB command.To list all user-defined command names, issue the command
/UCMD,STAT.
*deck,user01 user
function user01()
c *** primary function: user routine number 01
c /*******************************************************************\
c | this is a user routine that may be used by users to include their |
c | special coding. accesss to this routine is by the command usr1. |
c | usr1 may be changed by the user using the command /ucmd. the |
c | user may then use this routine to call his/her special routines. |
c | ansys routines to access information in the ansys database may be |
c | found in the "ansys programmer's manual", available from ansys,inc|
c | see user02 for a simple example usage. |
C | routines user03 to user10 are also available. |
C \*******************************************************************/
c output arguments:
c user01 (int,sc,out) - result code (should be zero)
c (which is ignored for now)
c **************************************************************
c Functions for accessing data on the command line
c integer function intinfun(iField) - gets an integer from field iField
c double precision function dpinfun(iField) - gets double precision
c character*4 ch4infun(iField) - gets (upper case) 4 characters
c character*8 ch8infun(iField) - gets (mixed case) 8 characters
c character*32 ch32infun(iField) - gets (mixed case) 32 characters
c **************************************************************
external wrinqr
integer wrinqr
iott = wrinqr(2)
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 175
Chapter 6: UPF Routines and Functions
return
end
*deck,user02 user
function user02()
c *** primary function: user routine number 02
c --- This demonstration offsets selected nodes with the command:
c usr2,dx,dy,dz
c /*******************************************************************\
c | see user01 for additional information on user routines |
c \*******************************************************************/
c output arguments:
c user02 (int,sc,out) - result code (should be zero)
c (which is ignored for now)
c **************************************************************
c Functions for accessing data on the command line
c integer function intinfun(iField) - gets an integer from field iField
c double precision function dpinfun(iField) - gets double precision
c character*4 ch4infun(iField) - gets (upper case) 4 characters
c character*8 ch8infun(iField) - gets (mixed case) 8 characters
c character*32 ch32infun(iField) - gets (mixed case) 32 characters
c **************************************************************
#include "ansysdef.inc"
maxnp = ndinqr(0,DB_MAXDEFINED)
c ***** get the desired offsets from the command line *****
offset(1) = dpinfun(2)
offset(2) = dpinfun(3)
offset(3) = dpinfun(4)
do i = 1,maxnp
ksel = ndgxyz (i,xyz(1))
if (ksel .eq. 1) then
xyz(1) = xyz(1) + offset(1)
xyz(2) = xyz(2) + offset(2)
xyz(3) = xyz(3) + offset(3)
call ndpxyz (i,xyz(1))
endif
enddo
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
176 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.7.3. Function user03 (Demonstrates Using ANSYS Memory)
write (iott,2000)
2000 format (/' NODE OFFSET COMPLETE '/)
*deck,user03 user
function user03()
c *** primary function: user routine number 03. Gives example of
c ANSYS Memory usage
c /*******************************************************************\
c | see user01 for additional information on user routines |
c \*******************************************************************/
c output arguments:
c user03 (int,sc,out) - result code (should be zero)
c (which is ignored for now)
c **************************************************************
c Functions for accessing data on the command line
c integer function intinfun(iField) - gets an integer from field iField
c double precision function dpinfun(iField) - gets double precision
c character*4 ch4infun(iField) - gets (upper case) 4 characters
c character*8 ch8infun(iField) - gets (mixed case) 8 characters
c character*32 ch32infun(iField) - gets (mixed case) 32 characters
c **************************************************************
#include "impcom.inc"
#include "ansysdef.inc"
c pointers:
pointer (pdXnodeL,Xnode)
pointer (pdYnodeL,Ynode)
pointer (pdZnodeL,Znode)
double precision Xnode(*), Ynode(*), Znode(*)
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 177
Chapter 6: UPF Routines and Functions
istat = 1
if (numnp .le. 0) go to 999
10 node = ndnext(node)
c increment index
i = i + 1
endif
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
178 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.7.4. Function user04
*deck,user04 user
function user04()
c *** primary function: user routine number 04; demonstrates gettting a
c list of nodes attached to a keypoint, line, or area
c /*******************************************************************\
c | see user01 for additional information on user routines |
c \*******************************************************************/
c output arguments:
c user04 (int,sc,out) - result code (should be zero)
c (which is ignored for now)
c **************************************************************
c Functions for accessing data on the command line
c integer function intinfun(iField) - gets an integer from field iField
c double precision function dpinfun(iField) - gets double precision
c character*4 ch4infun(iField) - gets (upper case) 4 characters
c character*8 ch8infun(iField) - gets (mixed case) 8 characters
c character*32 ch32infun(iField) - gets (mixed case) 32 characters
c **************************************************************
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 179
Chapter 6: UPF Routines and Functions
#include "ansysdef.inc"
lab2 = ch4infun(2)
write (iott,2010) lab2
2010 format(/' group name (type of entity) = ',a4)
num = intinfun(3)
write (iott,2020) num
2020 format (' entity number =',i4)
else
write (iott,2150)
2150 format (' Only KP, LN, or AR are acceptable on user-written ',
x 'gnsme command')
endif
user04 = 0
return
end
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
180 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.8.2. Function GetStackDisp (Getting Current Displacement Values)
*deck,GetRForce
function GetRForce (Node,Label,Value)
c primary function: Get the K * u - F at a node from the rfsum vector.
c warning: This routine is called after the elements
c are formed, but before solution. Therefore,
c F is from the current iteration, but
c u is from the previous iteration. At convergence,
c this difference will have little effect.
c The computations are done immediately after the
c call to UElMatx.
c Use the RFSUM command to ask for the summation.
c Use *GET,Parm,NODE,num,RF,DOFLAB to access the reaction
c sum from the command line.
c secondary functions: Return pointer for fast access
c object/library: usr
c input arguments:
c variable (typ,siz,intent) description
c Node (int,sc,in) - Node Number (User)
c Label (ch*4,sc,in) - DOF Label (Upper Case)
c 'UX ','UY ','TEMP','VOLT','ROTY', etc
c output arguments:
c GetRForce (int,func,out) - status/pointer
c = 0 - data not valid
c > 0 - Rfsum pointer to data for fast access
c see comments below
c Value (dp,sc,out) - Solution value for Node,Label
c All results are in the nodal coordinate
c system
c example usage:
c external GetRForce
c integer GetRForce, ptr, Node2
c double precision Value
c #include "handlecom.inc" (if Value = Rfsum(ptr) form is to be used)
c later...
c Value = Rfsum(ptr)
*deck,GetStackDisp
function GetStackDisp (Node,Label,Value)
c primary function: Get the displacement at a node from the disp vector
c secondary functions: Return pointer for fast access
c object/library: usr
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 181
Chapter 6: UPF Routines and Functions
c input arguments:
c variable (typ,siz,intent) description
c Node (int,sc,in) - Node Number (User)
c Label (ch*4,sc,in) - DOF Label (Upper Case)
c 'UX ','UY ','TEMP','VOLT','ROTY', etc
c output arguments:
c variable (typ,siz,intent) description
c GetStackDisp (int,sc,out) - status/pointer
c = 0 - data not valid
c > 0 - UDisp pointer to data for fast access
c see comments below
c Value (dp,sc,out) - Solution value for Node,Label
c example usage:
c external GetStackDisp
c#include "handlecom.inc" (only if UDisp(ptr) form is used
c integer GetStackDisp, ptr, Node2
c double precision Value
c later...
c Value = UDisp(ptr)
*deck,ElResultStrt
subroutine ElResultStrt (Label,Comp,LabAvg,TypeData,nVal,iLoc)
c *** primary function: (post1) Load data for later ElResultGet
c input arguments:
c Label (ch*4,sc,in) - Result Type
c Comp (ch*4,sc,in) - Result Component (8 char for ESTR)
c LabAvg (ch*4,sc,in) - 'AVG ' or 'NOAV' ('AVG ' default)
c output arguments:
c TypeData (int,sc,out) - Code for data type
c nVal (int,sc,out) - Number of values per point
c If 0, no data
c iLoc (int,sc,out) - Location of Comp in values
*deck,ElResultGet
subroutine ElResultGet (nPoints,ebest,elcord,TypeData,iLoc,
x nVal,result)
c *** primary function: (post1) Get results at selected points
c input arguments:
c nPoints (int,sc,in) - Number of evaluation points
c *** from ElInterp ***
c ebest (int,ar(nPoints),in) - Element(s) containing points
c elcord (dp,ar(3,nPoints),in) - Element coordinates
c *** from ElResultStrt ***
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
182 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.9. Access at the Beginning and End of Various Operations
c output arguments:
c Result (dp,ar(nvar,nPoints),out) - Array of results
*deck,ElInterp
subroutine ElInterp (piFEML,nPoints,xyzPoints,tolInsidein,
x tolOutsidein,MoveTol,ebest,elcord)
c object/library: upf
c input arguments:
c piFEML (ptr,sc,in) - If non 0, pointer of a FEM Object
c nPoints (int,sc,in) - Number of points to find (do in one group)
c xyzPoints(dp,ar(3,nPoints),in)- XYZ coordinates of each point
c tolInsidein(dp,sc,in) - Tolerance for point inside element
c (0.0d0 defaults to 1.0d-4)
c tolOutsidein(dp,sc,in) - Maximum distance outside to be associated
c with an element (0.0d0 defaults to 0.25)
c MoveTol (dp,sc,in) - Node move tolerance (0.0d0, no move)
c output arguments:
c ebest (int,ar(nPoints),out) - Best element number for each point
c elcord (dp,ar(3,nPoints),out) - Element coordinates of the point
Issue the USRCAL command (or use an equivalent menu path) to activate or deactivate these routines.
Subroutines USSBeg,UItBeg,UItFin and USSFin default to reading a command macro file from the current
working directory whose name is subroutine.mac (that is, ussfin.mac is read by USSFin.F). No user
action to relink the ANSYS program is required for the command macro to be read except that the calling sub-
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 183
Chapter 6: UPF Routines and Functions
routine must be activated by the USRCAL command.The design of the command reading ability of these sub-
routines is limited to APDL parameter setting commands (*GET, *SET, a = value, etc) and testing for general
ANSYS commands is limited. Commands which are known to work include *DIM, *STATUS. Commands which
require another line (*MSG, *VWRITE) are not allowed. Other commands which are known to not work are the
solution loading commands (D, F, SFE, and so on). If these capabilties are required, the user will need to create
a Fortran subroutine and link this subroutine into ANSYS, as described in Chapter 5: Using User Programmable
Features (UPFs).
While parameter substitution into commands is not permitted, USSBeg, and so on were designed to be used
in conjunction with dynamic tables and parameter substitution from the user subroutine. As an example, consider
an ANSYS table defined as d5 = f(par1), If d5 contains values of displacement as a function of PAR1, then d5 may
be used as a constraint, as
*dim,d5,table,10,1,1,PAR1
d5(1)=0,.1,.25,
/solu
d,5,ux,%d5%
Modify the value of PAR1 in USSBeg.MAC and the constraint on node 5, ux can then be modified in the middle
of a load step.
The following is an example of a valid input that may be read by USSBeg, UItBeg, UItFin and USSFin.
/COM, SAMPLE ussfin.mac
a=5
b=nx(1) ! *get function is ok
*get,c,active,solu,Time,cpu ! *get is ok
*dim,array,,6 ! array parameters are ok
array(1) = 1
array(2) = 2
array(3) = 3
array(4) = 4
array(5) = 5
array(6) = 6
*vleng,3 ! vector operations are ok
*vfun,array(4),copy,array(1)
*stat
*stat,array(1)
array(1)=
nnode = ndinqr(0,14)
*dim,array,,nnode
*vget,array(1),NODE,1,NSEL
*stat,array(1)
array(1)=
/eof
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
184 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.10.2. Subroutine userop (Defining a Custom Optimization Routine)
This chapter describes both methods.You can find additional information on design optimization techniques
and procedures in the Advanced Analysis Techniques Guide.
However, if you plan to use an optimization routine of your own design, you must do the following:
1. Define parameters for your external optimization routine, using either the OPUSER command or GUI
path Main Menu>Design Opt>Method/Tool. (For more information about OPUSER, see the Commands
Reference.)
2. Either issue the OPTYPE,USER command or choose menu path Main Menu>Design Opt>Method/Tool
and specify User Optimizer.
3. Issue the OPEXE command or choose GUI path Main Menu>Design Opt>Run.
Issuing the OPTYPE,USER command (or its GUI equivalent) instructs the ANSYS program to bypass the standard
ANSYS design optimizer logic and instead execute your custom optimization routine.
The userop routine (below) includes a flow chart showing how a user-defined optimization routine interacts
with the ANSYS program. It also contains a commented example that shows you sample ANSYS command input
for design optimization, done with a user-customized version.
For information about the kopusr variable and the userop routine, see the next section.
Below is a listing of the header information foruserop which includes the inputs and outputs and an example
user optimization:
*deck,userop user
subroutine userop (iott,nterm,maxparm,optvar)
c primary purpose: user-supplied optimization routine
c accessed with optype,user
c other input comes from the opuser command
c
c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.
c *** ansys, inc.
c *** Notice - This file contains ANSYS Confidential information ***
c
c****************************************************************************
c *
c incoming arguments: *
c *
c *
c iott = ansys output unit *
c *
c nterm = looping control parameter *
c passed back to routine opterm. this variable should be set *
c as follows: *
c nterm = 0 if optimization looping should stop *
c nterm = 1 if optimization looping should continue *
c *
c maxparm = maximum number of parameters (first dimension on optvar) *
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 185
Chapter 6: UPF Routines and Functions
c *
c optvar = optimization variables (see documentation in cmopt.inc) *
c *
c****************************************************************************
c
c *** simplified flowchart of how user optimization interfaces with ansys
c
c ******************
c * *
c * start *
c * *
c ******************
c i
c i
c i
c vvv
c v
c ***********************
c * *
c * analysis file setup *
c * /PREP7 *
c * /SOLUTION *
c * /POST1 *
c * FINISH *
c * *
c ***********************
c i
c i
c i
c i
c vvv
c v
c ****************
c * *
c * /opt module *
c * opt commands *
c * OPEXE *
c * *
c ****************
c i
c i
c i
c i
c vvv
c v
c ******************
c * *
c * ansys analysis *<<<-------------------------------------
c * use setup file * i
c * * i
c ****************** i
c i i
c i i
c i i
c vvv i
c v i
c ********** i
c * * i
c * * yes i
c * kopusr > 0 *-------------------- i
c * * i i
c * * i i
c ********** i i
c i i i
c i i i
c i no i i
c i i i
c i i i
c vvv vvv i
c v v i
c ********************* ********************* i
c * * * * i
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
186 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.10.3. Structuring Your Input
c * ansys * * userop * i
c * optimization * * optimization * i
c * * * call userop * i
c ********************* ********************* i
c i i i
c i i i
c i i i
c ---------------------------- i
c i i
c vvv i
c v i
c @@@ i
c **************** @ @ i
c * * yes @ @ i
c * exit *<<<-----@ terminate @ i
c * *(nterm=0) @ looping?@ i
c **************** @ @ i
c @@@ i
c i i
c i no i
c i (nterm=1) i
c vvv i
c v i
c ***************************** i
c * * i
c * move optimization results *----- to new ----->>>i
c * into parameter vector * analysis
c * *
c *****************************
c
c
c *** sample input for user optimization ***
c
c!!!---- minimize y = x1**2 + x2**2
c!!! --- subject to : 1 < x1 < 10
c!!! --- 1 < x2 < 10
c!!! --- g = x1 - x2 > 1
c
c /batch,list ! use batch mode
c x1=5 ! initial value for dv x1
c x2=5 ! initial value for dv x2
c /prep7 ! enter prep
c y = x1*x1 + x2*x2 ! define function y
c g = x1 - x2 ! define function g
c finish ! finish prep
c /opt ! enter opt
c opvar,x1,dv,1,10 ! define 1st dv (range 1 to 10)
c opvar,x2,dv,1,10 ! define 2nd dv (range 1 to 10)
c opvar,y,obj,,,1 ! define objective function (tol = 1)
c opvar,g,sv,1 ! define state variable (lower limit 1)
c optype,user ! opt method is user supplied
c opuser,10,1.1,2.0 ! defime user opt modifiers (max iterations=10)
c opexe ! execute opt
c oplist,all ! list results
c finish
When you finish customizing the userop routine, you relink it using either of the methods described in the In-
stallation and Configuration Guide.You must include the cmopt common block in your routine, to allow it to
pass common data (such as design variables, state variables, and objective function values) to and from the
ANSYS program.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 187
Chapter 6: UPF Routines and Functions
/OPT
OPTYPE,USER ! ANSYS optimization logic bypassed
OPUSER, ! user-defined optimization to be done
OPVAR ! design and state variables & objective function values defined
.
.
.
OPEXE ! looping begins
You may certainly use the system malloc and free functions or, for FORTRAN, the allocate system function. However,
you may end up competing with ANSYS for memory, and for large problems there may be insufficient system
memory to perform the function.
Dynamic memory is done through Cray-style pointers, where a dynamically allocated array is defined via the
construct
pointer (piArray,Array)
integer Array(*)
and memory space for the array is allocated by assigning the pointer, in this case piArray, to the allocated memory
space:
piArray = fAnsMemAlloc (size,...)
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
188 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.11.3. Subroutine fAnsMemFree (Deallocating Space)
prArray = fAnsMemAlloc(rleng,MEM_REAL,C16Label)
You must include the ansysdef.inc include file to get the parameter values of MEM_INTEGER,
MEM_DOUBLE, MEM_COMPLEX, and MEM_REAL.
Note
The next two sections provide input and output listings for the memory management routines.
For an example, see Section 6.7.3: Function user03 (Demonstrates Using ANSYS Memory), which appears earlier in
this chapter.
*deck,fAnsMemAlloc
function fAnsMemAlloc (iLen, key, c16Label)
c primary function: Get A Block of Space from mem manager and Return Pointer
c object/library: mem
c input arguments:
c iLen (int,sc,in) - length of the block (in data elements)
c c16Label (chr*16,sc,in) - 16 character name for the Block
c key (int,sc,in) - type of data for this block (see ansysdef)
c output arguments:
c fAnsMemAlloc (PTRFTN,sc,out) - Pointer to this data block -- needs to be
c tied to a local variable in the calling
c routine
*deck,fAnsMemFree
subroutine fAnsMemFree (memPtr)
c primary function: Free a Data Block, given a pointer
c object/library: mem
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 189
Chapter 6: UPF Routines and Functions
c input arguments:
c ptr (PTRFTN,sc,inout) - pointer for this block
c output arguments:
c ptr (PTRFTN,sc,inout) - pointer will be set to zero
*deck,pardim
subroutine pardim (cName,labl4,nDim,nxyz,cLabels)
c *** primary function: create a dimensioned parameter
c *dim,parm32,type,d1,d2,d3,cName1,cName2,cName3
c *dim,parm32,type,d1,cName1
c *dim,parm32,type,d1,d2,d3,d4,d5,cName1,cName2,cName3,cName4,cName5
c input arguments:
c cName (chr*32,sc,in) - the name of the parameter to create
c labl4 (chr*4,sc,in) - 'TABL' or 'ARRA' or 'CHAR' or 'STRI'
c nDim (int,sc,in) - Dimension of array
c nxyz (int,ar(nDim),in) - the dimensions of the array
c cLabels (chr*32,ar(nDim),in) - Names for the directions in table
*deck,parevl
subroutine parevl (ParName,nDim,subc,lvl,dpValue,chValue,kerr)
c *** primary function: find and evaluate a parameter
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c input arguments:
c ParName (chr*(PARMSIZE),sc,in) - the name of the parameter
c (must be upper case, left justified)
c nDim (int,sc,in) - the number of subscripts (0,scaler)
c subc (dp,ar(*),in) - values for the subscripts (if any)
c lvl (int,sc,in) - 0,1 no error output 2, report error
c -1, set kerr flag with no anserr call
c
c output arguments:
c dpValue (dp,sc,out) - the value of the parameter (may be a
c packed character*8
c chValue (ch*128,sc,out) - character output
c kerr (int,sc,out) - error flag (0,ok -1,output is packed
c 0=ok, 1=error, 2=error but TINY is used
c -2, output is string in chValue
c
c
*deck,pardef
subroutine pardef (label,ctype,nval,subc,valuein,kerr,string)
c *** primary function: add a parameter to parameter list
c
c *** Notice - This file contains ANSYS Confidential information ***
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
190 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.12.3. Subroutine pardef (Adding a Parameter)
c
c input arguments:
c label (chr*(PARMSIZE),sc,in) - name of parameter
c label is a character variable that
c contains the name of the parameter that
c is to be defined. (Length = PARMSIZE characters)
c
c ctype (int,sc,in) - 0, dp 1,character 2,string
c ctype is an integer key which describes
c the type of data that the parameter data
c holds. This would also indicate the
c contents of "value" (arg 5).
c 0=double precision data
c 1=character data packed in value
c 2=character data in string
c
c nval (int,sc,in) - number of subscripts
c nval is the number of subscripts that the
c "label" (arg 1) contains.
c 1=single dimensioned variable (ex. x(10))
c 2=double dimensioned variable (ex. y(10,3))
c 3=triple dimensioned variable (ex. z(10,3,2))
c -1=delete this parameter from the internal
c tables.
c
c subc (dp,ar(*),in) - values of subscripts
c subc is a double precision vector that
c contains the subscripts of "label" (arg 1).
c There should be enough values defined to
c match "nval" (arg 3). For example if "x"
c was dimensioned as "x(10,3,2)" and you wanted
c to set "x(5,1,1)=123.0", then "nval" (arg 3)
c should be set to 3, and "subc" should be set
c to 5.0, 1.0, 1.0, and "value" (arg 5) should
c be 123.0. Another example is if "y" was
c dimensioned to as "y(20,20)" and you were
c setting "y(5,8)=987", then "nval" (arg 3) should
c be set to 2 and "subc" should be set to 5.0,
c 8.0, 0.0, and "value" (arg 5) should be 987.0.
c
c Remember subroutine "pardef" is only storing
c a data value of "label" or "label(x,y,z)". The
c proper dimensions were set by a "*dim" command.
c
c Please note that although the values of "subc"
c should be double precision, subroutine "pardef"
c uses the intrinsic "nint" (nearest integer)
c function to get and use the integer equivalent.
c
c You should also note the "nval" (arg 3) and
c "subc" (arg 4) must fall within the range that was
c set with a "*dim" or "*set" command or an error
c will occur.
c
c valuein(dp,sc,in) - the value for this parameter
c (should be a packed character*8 if
c ctype=1. To pack a char into a dp
c variable use "call chtodp(ch8,dp)".
c To unpack a dp variable into a char
c use "call dptoch(dp,ch8)" )
c Value is the data value that is to be stored for
c "label" (arg 1). If "ctype=1" (arg 2) then this
c value would be a "packed character" data from the
c "chtodp" Ansys function.
c
c output arguments:
c kerr (int,sc,out) - error flag (0=ok, 1=error)
c kerr is an integer error flag that is
c returned to the calling subroutine. Any
c non zero number would indicate an error
c was detected in subroutine "pardef"
c
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 191
Chapter 6: UPF Routines and Functions
The erhandler routine displays output messages (notes, warnings, and errors).
The RunCommand function lets you issue an ANSYS command from within a user routine.
The GetStackDisp routine retrieves current displacement values.
The /UNDO command writes an "undo" file at critical points as a user routine executes.
The/HOLD command allows you to synchronize multiple tasks in ANSYS.
The /TRACK command enables you to do program tracing and timing.
For further descriptions of erhandler and /TRACK, see Chapter 8: Subroutines for Users' Convenience. For details
about the GetStackDisp function, see Section 6.8.2:Function GetStackDisp (Getting Current Displacement Values).
*deck,RunCommand
function RunCommand (nChar,command)
c object/library: upf
c input arguments:
c nChar (int,sc,in) - Length of the command string (8 min)
c command (ch*(nChar),sc,in) - A character string containing a
c valid ANSYS command
c output arguments:
c RunCommand (int,sc,out) - An internally defined value, ignore
Action
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
192 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
6.13.3. Using the /HOLD command
Filename
The eight-character name of a message file. If the named file exists, the ANSYS program reads a command
from the file and then deletes the file.
TimeInterval
The length of time, in seconds, that ANSYS waits before trying to read the message file again.
Timeout
The maximum length of time, in seconds, that ANSYS can wait between attempts to read the file.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 193
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
194 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 7: Accessing the ANSYS Database
This chapter describes how you can retrieve information in the ANSYS database (or store information in the
database) by linking subroutines you create into the ANSYS program.
You can use the database access routines with any of the user-programmable features. For example, you can
create your own ANSYS commands and use them to execute database access routines (or have a database access
routine call a user-defined command).
int - integer
dp - double precision
log - logical
chr - character
dcp - double precision complex
Argument size is one of the following:
sc - scalar variable
ar(n) - array variable of length n
func - functional return value
Argument intent is one of the following:
in - input argument
out - output argument
inout - both an input and an output argument
*deck,ndnext
function ndnext (next)
c *** primary function: get the number of the next selected node
c input arguments:
c next (int,sc,in) - the last node number used
c = 0 - use for initial value
c output arguments:
c ndnext (int,func,out) - the next selected node number
c = 0 - no more nodes
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 195
Chapter 7: Accessing the ANSYS Database
7.3.2. ndprev Function (Getting the Number of the Previous Selected Node)
*deck,ndprev
function ndprev (next)
c *** primary function: get the number of the previous selected node
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c typ=int,dp,log,chr,dcp siz=sc,ar(n),func intent=in,out,inout
c
c input arguments:
c variable (typ,siz,intent) description
c next (int,sc,in) - the next node number used
c = 0 - use for initial value
c
c output arguments:
c ndprev (int,func,out) - the previous selected node number
c = 0 - no more nodes
c
7.3.3. ndnxdf Function (Getting the Number of the Next Defined Node)
*deck,ndnxdf
function ndnxdf (next)
c *** primary function: get the number of the next defined node
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c typ=int,dp,log,chr,dcp siz=sc,ar(n),func intent=in,out,inout
c
c input arguments:
c variable (typ,siz,intent) description
c next (int,sc,in) - the last node number used
c = 0 - use for initial value
c
c output arguments:
c ndnxdf (int,func,out) - the next defined node number
c = 0 - no more nodes
c
c
*deck,ndsel
subroutine ndsel (ndmi,ksel)
c *** primary function: to select, unselect, delete, or invert a node.
c *** secondary functions: none.
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c typ=int,dp,log,chr,dcp siz=sc,ar(n),func intent=in,out,inout
c
c input arguments:
c variable (typ,siz,intent) description
c ndmi (int,sc,in) - node number
c = 0 - all nodes
c < 0 - do not delete CPs and CEQNs
c (merge/offset/compress)
c ksel (int,sc,in) - type of operation to be performed.
c ksel = 0 - delete node.
c = 1 - select node.
c =-1 - unselect node.
c = 2 - invert select status of node.
c
c output arguments:
c none.
c
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
196 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.3.8. elsel Subroutine (Selecting, Unselecting, Deleting, or Inverting an Element)
*deck,elnext
function elnext (next)
c *** primary function: get the number of the next selected element
c input arguments:
c next (int,sc,in) - the last element number used
c = 0 - use for initial value
c output arguments:
c elnext (int,func,out) - the next selected element
c = 0 - no more elements
7.3.6. elprev Function (Getting the Number of the Previous Selected Element)
*deck,elprev
function elprev (prev)
c *** primary function: get the number of the previous selected element
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c typ=int,dp,log,chr,dcp siz=sc,ar(n),func intent=in,out,inout
c
c input arguments:
c variable (typ,siz,intent) description
c prev (int,sc,in) - the last element used
c = 0 - use for initial value
c
c output arguments:
c elprev (int,func,out) - the previous selected element
c = 0 - no more elements
c
7.3.7. elnxdf Function (Getting the Number of the Next Defined Element)
*deck,elnxdf
function elnxdf (next)
c *** primary function: get the number of the next defined element
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c typ=int,dp,log,chr,dcp siz=sc,ar(n),func intent=in,out,inout
c
c input arguments:
c variable (typ,siz,intent) description
c next (int,sc,in) - the last element used
c = 0 - use for initial value
c
c output arguments:
c elnxdf (int,func,out) - the next defined element
c = 0 - no more elements
c
*deck,elsel
subroutine elsel (ielei,ksel)
c *** primary function: to select, unselect, delete, or invert an element.
c input arguments:
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 197
Chapter 7: Accessing the ANSYS Database
*deck,ndinqr
function ndinqr (node,key)
c *** primary function: get information about a node.
c *** secondary functions: set current node pointer to this node.
c input arguments:
c node (int,sc,in) - node number
c Should be 0 for key=11, DB_NUMDEFINED,
c DB_NUMSELECTED, DB_MAXDEFINED, and
c DB_MAXRECLENG
c key (dp,sc,in) - key as to information needed about
c the node.
c = DB_SELECTED - return select status:
c ndinqr = 0 - node is undefined.
c =-1 - node is unselected.
c = 1 - node is selected.
c = DB_NUMDEFINED - return number of defined nodes
c = DB_NUMSELECTED - return number of selected nodes
c = DB_MAXDEFINED - return highest node number defined
c = DB_MAXRECLENG - return maximum record length (dp words)
c = 2, return length (dp words)
c = 3,
c = 4, pointer to first data word
c = 11, return void percent (integer)
c = 17, pointer to start of index
c = -1,
c = -2, superelement flag
c = -3, master dof bit pattern
c = -4, active dof bit pattern
c = -5, solid model attachment
c = -6, pack nodal line parametric value
c = -7, constraint bit pattern
c = -8, force bit pattern
c = -9, body force bit pattern
c = -10, internal node flag
c = -11, orientation node flag =1 is =0 isnot
c = -11, contact node flag <0
c = -12, constraint bit pattern (for DSYM)
c = -13, if dof constraint written to file.k (for LSDYNA only)
c = -14, nodal coordinate system number (set by NROTATE)
c =-101, pointer to node data record
c =-102, pointer to angle record
c =-103,
c =-104, pointer to attached couplings
c =-105, pointer to attacted constraint equations
c =-106, pointer to nodal stresses
c =-107, pointer to specified disp'S
c =-108, pointer to specified forces
c =-109, pointer to x/y/z record
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
198 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.4.4. ndgall Function (Getting the XYZ/Rotation Coordinates Vector for a Node)
c =-110,
c =-111,
c =-112, pointer to nodal temperatures
c =-113, pointer to nodal heat generations
c =-114,
c =-115, pointer to calculated displacements
c =-116,
c output arguments:
c ndinqr (int,func,out) - the returned value of ndinqr is based on
c setting of key.
*deck,getnod
subroutine getnod (node,v,kerr,kcrot)
c *** primary function: get a nodal point
c input arguments:
c node (int,sc,in) - node number
c kerr (int,sc,inout) - message flag
c = 0 - print no message if node is unselected
c or undefined
c = 1 - print message if node is undefined
c = 2 - print message if node is undefined
c or unselected
c kcrot (int,sc,in) - output coordinates in this coordinate system.
c if kcrot is negative, output theta and
c phi coordinates in radians
c output arguments:
c v (dp,ar(6),out) - Coordinates (first 3 values) and rotation
c angles (last 3 values)
c kerr (int,sc,inout) - select status
c = 0 - node is selected
c = 1 - node is not defined
c =-1 - node is unselected
*deck,putnod
subroutine putnod (node,vctn,kcrot)
c *** primary function: store a node
c *** secondary functions: display node if in immediate mode.
c input arguments:
c node (int,sc,in) - node number
c vctn (dp,ar(6),in) - array of 3 nodal coordinates and
c 3 nodal rotation angles.
c kcrot (int,sc,in) - local coordinate system in which the nodal
c coordinates and angles are defined
7.4.4. ndgall Function (Getting the XYZ/Rotation Coordinates Vector for a Node)
*deck,ndgall
function ndgall (node,xyz)
c *** primary function: get x,y,z,rotx,roty,rotz vector for a node.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 199
Chapter 7: Accessing the ANSYS Database
c input arguments:
c node (int,sc,in) - node number for operation.
c output arguments:
c ndgall (int,sc,out) - status of node.
c 0=node is undefined.
c -1=node is unselected.
c 1=node is selected.
c xyz (dp,ar(6),out) - vector containing x,y,z,rotx,roty,rotz
7.4.5. ndspgt Subroutine (Getting the Nodal Solution for a Node of an Element)
*deck,ndspgt
subroutine ndspgt (node,dofs,ndof,nrot,xyzang,nuvect,unode)
c *** primary function: get the nodal solution for a node of an element
c input arguments:
c node (int,sc,in) - The node number
c dofs (int,ar(DOFBITLENG),in) - The dofs to retrieve for the node.
c dof = degree of freedom
c The dofs array should be zeroed out,
c except for the needed parts.
c dofs is a bit pattern with true bits
c representing the GLOBAL Dof set desired.
c That is, dofs(1) is used for UX to SP06,
c and dofs(2) is used for TBOT to TTOP.
c See ECHPRM for details. For example,
c dofs(1) = UX + TEMP
c dofs(2) = TE3
c TTOP is a special case. If you want
c TTOP alone, use:
c dofs(2) = ibset(0,TTOP)
c If TBOT and TTOP are desired, you must use:
c dofs(2) = TBOT
c dofs(2) = ibset(dofs(2),TTOP)
c ndof (int,sc,in) - The number of node dofs (1, 2 or 3).
c nrot (int,sc,in) - Key to rotate dofs from nodal to global
c coordinate systems.
c if 0, none. if 2, 2-d. if 3, 3-d
c if > 0, dof set must include and only
c include all terms of the vector (e.g.
c UX,UY,UZ, or AX,AY,AZ).
c xyzang (dp,ar(6),in) - The xyz virgin node coordinates
c (including angles). Not used if
c nrot = 0 or ndof < 2.
c nuvect (int,sc,in) - Number of vectors to retrieve. Can vary
c between 1 and 5. Normally 1 is what is
c wanted. Other vectors include previous
c values and/or velocities. See elucom for
c all possibilites. Contents are analysis
c type dependent.
c output arguments:
c unode (dp,ar(ndof,nuvect),out) - Element nodal solution vectors in
c the global coordinate system.
*deck,elmiqr
function elmiqr (ielem,key)
c *** primary function: get information about an element.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
200 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.5.2. elmget Function (Getting an Element's Attributes and Nodes)
c input arguments:
c ielem (int,sc,in) - element number
c should be zero for key=11, DB_NUMDEFINED,
c DB_NUMSELECTED, or DB_MAXDEFINED
c key (int,sc,in) - information flag.
c = DB_SELECTED - return select status: (1)
c elmiqr = 0 - element is undefined.
c =-1 - element is unselected.
c = 1 - element is selected.
c = DB_NUMDEFINED - return number of defined elements (12)
c = DB_NUMSELECTED - return number of selected elements (13)
c = DB_MAXDEFINED - return maximum element number used (14)
c = DB_MAXRECLENG - return maximum record length (15)
c (int words)
c = 2 - return length (int words)
c = 3 - return layer number
c (for cross reference files return number of entities)
c = 4 - return address of first data word
c = 5 - return length (in record type units)
c = 6 - return compressed record number.
c = 11 - return void percent (integer)
c = 16 - return location of next record
c (this increments the next record count)
c = 17 - pointer to start of index
c = 18 - return type of file.
c elmiqr = 0 - integer
c = 1 - double precision
c = 2 - real
c = 3 - complex
c = 4 - character*8
c = 7 - index
c = 19 - return virtual type of file.
c elmiqr = 0 - fixed length (4.4 form)
c = 1 - indexed variable length (layer data)
c = 2 - xref data tables
c = 3 - bitmap data (for 32 data item packed records)
c = 4 - data tables (three dimensional arrays)
c = -1 - material number etc. (see elmcmx)
c =-101 - pointer to element integers etc.
c (see elmcmx with elmilg and 1 instead of -101)
c
c output arguments:
c elmiqr (int,sc,out) - the returned value of elmiqr is based on
c setting of key.
c
c
*deck,elmget
function elmget (ielem,elmdat,nodes)
c *** primary function: get element attributes and nodes.
c input arguments:
c ielem (int,sc,in) - element number
c output arguments:
c elmget (int,func,out) - status of element.
c = 0 - element undefined
c < 0 - number of nodes on unselected
c element
c > 0 - number of nodes on selected element
c elmdat (int,ar(EL_DIM),in) - element attributes.
c elmdat(EL_MAT) - material number
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 201
Chapter 7: Accessing the ANSYS Database
*deck,elmput
subroutine elmput (ielem,elmdat,nnod,nodes)
c *** primary function: store element attributes and node numbers.
c *** secondary functions: set current element pointer to this element.
c *** NOTICE - The user is also responsible for defining the centroid for the
c element using the elmpct subroutine. Calling the elmput
c subroutine will NULL the element centroid previously defined.
c input arguments:
c ielem (int,sc,in) - element number
c elmdat (int,ar(EL_DIM),in) - element attributes.
c elmdat(EL_MAT) - material number
c (EL_TYPE) - element type
c (EL_REAL) - real constant number
c (EL_SECT) - section number
c (EL_CSYS) - coordinate system number
c (EL_DEAD) - death flag (bit 0)
c if clear - alive
c if set - dead
c (EL_SOLID) - solid model reference
c (EL_SHAPE) - 100*shape + specific shape
c (EL_OBJOPTIONS) - reserved
c (EL_PEXCLUDE) - p element include flag
c (bit 0)
c if clear - include
c if set - exclude
c For LSDYNA, it means part ID
c in reqular ANSYS, it is never part ID
c nnod (int,sc,in) - number of nodes for this element.
c nodes (int,ar(*),in) - node numbers for this element.
*deck,etyiqr
function etyiqr (itype,key)
c *** primary function: get information about an element type.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
202 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.5.7. echrtr Subroutine (Getting Information About Element Characteristics)
c input arguments:
c itype (int,sc,in) - element type number
c Should be 0 for key=11, DB_NUMDEFINED,
c DB_NUMSELECTED, DB_MAXDEFINED, and
c DB_MAXRECLENG
c key (int,sc,in) - information flag.
c = DB_SELECTED - return select status:
c etyiqr = 0 - element type is undefined.
c =-1 - element type is unselected.
c = 1 - element type is selected.
c = DB_NUMDEFINED - return number of defined element types
c = DB_NUMSELECTED - return number of selected element types
c = DB_MAXDEFINED - return highest element type number defined
c = DB_MAXRECLENG - return maximum record length (int words)
c = -n, return element characteristic n from etycom for element
c type itype.
c n is correlated to the parameter names in echprm.
c see elccmt for definitions of element characteristics.
c note- this will not overwrite the current setting of
c etycom.
c output arguments:
c etyiqr (int,func,out) - the returned value of etyiqr is based on
c setting of key.
*deck,etyget
function etyget (itype,ielx)
c *** primary function: get element type data.
c input arguments:
c itype (int,sc,in) - element type number
c output arguments:
c etyget (int,func,out) - status of element type.
c = 0 - element type is undefined.
c < 0 - number of data items on unselected
c element type.
c > 0 - number of data items on selected
c element type.
c ielx (int,ar(*),out) - element type data. see elccmt for
c description of data.
*deck,etyput
subroutine etyput (itype,n,ielx)
c *** primary function: store element type data.
c input arguments:
c itype (int,sc,in) - element type number for operation.
c n (int,sc,in) - length of data vector to store.
c ielx (int,ar(*),in) - element type data. see elccmt for
c description.
*deck
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 203
Chapter 7: Accessing the ANSYS Database
*deck,etysel
subroutine etysel (itypi,ksel)
c *** primary function: to select, unselect, delete, or invert an
c element type.
c *** secondary functions: none.
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c typ=int,dp,log,chr,dcp siz=sc,ar(n),func intent=in,out,inout
c
c input arguments:
c variable (typ,siz,intent) description
c itypi (int,sc,in) - element type number
c = 0 - all element types
c ksel (int,sc,in) - type of operation to be performed.
c = 0 - delete element type.
c = 1 - select element type.
c =-1 - unselect element type.
c = 2 - invert element type.
c
c output arguments:
c none.
c
*deck,mpinqr
function mpinqr (mat,iprop,key)
c *** primary function: get information about a material property.
c input arguments:
c mat (int,sc,in) - material number
c should be 0 for key=11,
c DB_NUMDEFINED(12),
c DB_MAXDEFINED(14), and
c DB_MAXRECLENG(15)
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
204 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.5.10. mpget Function (Getting a Material Property Table)
c output arguments:
c mpinqr (int,func,out) - returned value of mpinqr is based on
c setting of key.
*deck,mpget
function mpget (mat,iprop,temp,prop)
c *** primary function: get a material property table.
c input arguments:
c variable (typ,siz,intent) description
c mat (int,sc,in) - material number
c iprop (int,sc,in) - property reference number:
c ---- MP command labels --------
c EX = 1, EY = 2, EZ = 3, NUXY= 4, NUYZ= 5, NUXZ= 6, GXY = 7, GYZ = 8
c GXZ = 9, ALPX=10, ALPY=11, ALPZ=12, DENS=13, MU =14, DAMP=15, KXX =16
c KYY =17, KZZ =18, RSVX=19, RSVY=20, RSVZ=21, C =22, HF =23, VISC=24
c EMIS=25, ENTH=26, LSST=27, PRXY=28, PRYZ=29, PRXZ=30, MURX=31, MURY=32
c MURZ=33, PERX=34, PERY=35, PERZ=36, MGXX=37, MGYY=38, MGZZ=39, EGXX=40
c EGYY=41, EGZZ=42, SBKX=43, SBKY=44, SBKZ=45, SONC=46, SLIM=47, ELIM=48
c USR1=49, USR2=50, USR3=51, USR4=51, FLUI=53, ORTH=54, CABL=55, RIGI=56
c HGLS=57, BM =58, QRAT=59, REFT=60, CTEX=61, CTEY=62, CTEZ=63, THSX=64,
c THSY=65, THSZ=66, DMPR=67, LSSM=68, =69, =79, =71, =72,
c =73, =74, =75, =76, =77, =78, =79, =80
c
c (see mpinit for uncommented code and TB command information)
c output arguments:
c mpget (int,func,out) - number of temperature values
c temp (dp,ar(mpget),out) - vector of the temperature values
c prop (dp,ar(mpget),out) - vector of the property values
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 205
Chapter 7: Accessing the ANSYS Database
*deck,mpput
subroutine mpput (mat,iprop,ntab,temp,prop)
c *** primary function: store material property tables.
c input arguments:
c mat (int,sc,in) - material number.
c iprop (int,sc,in) - property reference number:
c ---- MP command labels --------
c EX = 1, EY = 2, EZ = 3, NUXY= 4, NUYZ= 5, NUXZ= 6, GXY = 7, GYZ = 8
c GXZ = 9, ALPX=10, ALPY=11, ALPZ=12, DENS=13, MU =14, DAMP=15, KXX =16
c KYY =17, KZZ =18, RSVX=19, RSVY=20, RSVZ=21, C =22, HF =23, VISC=24
c EMIS=25, ENTH=26, LSST=27, PRXY=28, PRYZ=29, PRXZ=30, MURX=31, MURY=32
c MURZ=33, PERX=34, PERY=35, PERZ=36, MGXX=37, MGYY=38, MGZZ=39, EGXX=40
c EGYY=41, EGZZ=42, SBKX=43, SBKY=44, SBKZ=45, SONC=46, SLIM=47, ELIM=48
c USR1=49, USR2=50, USR3=51, USR4=51, FLUI=53, ORTH=54, CABL=55, RIGI=56
c HGLS=57, BM =58, QRAT=59, REFT=60, CTEX=61, CTEY=62, CTEZ=63, THSX=64,
c THSY=65, THSZ=66, DMPR=67, LSSM=68, =69, =79, =71, =72,
c =73, =74, =75, =76, =77, =78, =79, =80
c
c (see mpinit for uncommented code and TB command information)
c output arguments:
c none.
*deck,mpdel
subroutine mpdel (mat,iprop)
c *** primary function: delete material property tables.
c input arguments:
c mat (int,sc,in) - material number.
c iprop (int,sc,in) - property reference number:
c (0 = all properties)
c ---- MP command labels --------
c EX = 1, EY = 2, EZ = 3, NUXY= 4, NUYZ= 5, NUXZ= 6, GXY = 7, GYZ = 8
c GXZ = 9, ALPX=10, ALPY=11, ALPZ=12, DENS=13, MU =14, DAMP=15, KXX =16
c KYY =17, KZZ =18, RSVX=19, RSVY=20, RSVZ=21, C =22, HF =23, VISC=24
c EMIS=25, ENTH=26, LSST=27, PRXY=28, PRYZ=29, PRXZ=30, MURX=31, MURY=32
c MURZ=33, PERX=34, PERY=35, PERZ=36, MGXX=37, MGYY=38, MGZZ=39, EGXX=40
c EGYY=41, EGZZ=42, SBKX=43, SBKY=44, SBKZ=45, SONC=46, SLIM=47, ELIM=48
c USR1=49, USR2=50, USR3=51, USR4=51, FLUI=53, ORTH=54, CABL=55, RIGI=56
c HGLS=57, BM =58, QRAT=59, REFT=60, CTEX=61, CTEY=62, CTEZ=63, THSX=64,
c THSY=65, THSZ=66, DMPR=67, LSSM=68, =69, =79, =71, =72,
c =73, =74, =75, =76, =77, =78, =79, =80
c
c (see mpinit for uncommented code and for TB command information)
*deck,rlinqr
function rlinqr (nreal,key)
c *** primary function: get information about a real constant set
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
206 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.5.15. rlsel Subroutine (Selecting or Deleting a Real Constant Set)
c input arguments:
c variable (typ,siz,intent) description
c nreal (int,sc,in) - real constant table number
c should be 0 for key=11, DB_NUMDEFINED,
c DB_NUMSELECTED, DB_MAXDEFINED, and
c DB_MAXRECLENG
c key (int,sc,in) - information flag.
c = 5 - return number of values stored for nreal
c = DB_SELECTED - return select status
c rlinqr = 0 - real constant table is undefined.
c =-1 - real constant table is unselected.
c = 1 - real constant table is selected
c = DB_NUMDEFINED - return number of defined real constant tables
c = DB_NUMSELECTED - return number of selected real constant tables
c = DB_MAXDEFINED - return highest real constant table defined
c = DB_MAXRECLENG - return maximum record length (dp words)
c output arguments:
c rlinqr (int,func,out) - the returned value of rlinqr is based on
c setting of key.
c
*deck,rlget
function rlget (nreal,rtable)
c *** primary function: get real constant data
c input arguments:
c nreal (int,sc,in) - real constant table number
c output arguments:
c rlget (int,func,out) - number of real constant data obtained
c rtable (dp,ar(*),out) - real constant data obtained
*deck,rlsel
subroutine rlsel (nreai,ksel)
c *** primary function: select or delete a real constant set
c *** secondary functions: none
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c typ=int,dp,log,chr,dcp siz=sc,ar(n),func intent=in,out,inout
c
c input arguments:
c variable (typ,siz,intent) description
c nreai (int,sc,in) - real constant table
c = 0 - all real constant tables
c ksel (int,sc,in) - type of operation to be performed.
c = 0 - delete real constant table.
c = 1 - select real constant table.
c =-1 - unselect real constant table.
c = 2 - invert real constant table.
c
c output arguments:
c none
c
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 207
Chapter 7: Accessing the ANSYS Database
*deck,csyiqr
function csyiqr (ncsy,key)
c *** primary function: get information about a coordinate system
c input arguments:
c ncsy (int,sc,in) - coordinate system reference number
c should be zero for key= DB_NUMDEFINED
c or DB_MAXDEFINED
c key (int,sc,in) - information flag.
c = DB_SELECTED - return status:
c csyiqr = 0 - coordinate system is not defined
c -1 - coordinate system is not selected
c 1 - coordinate system is selected
c = DB_NUMDEFINED - number of defined coordinate systems
c = DB_MAXDEFINED - maximum coordinate system reference
c number used.
c output arguments:
c csyiqr (int,func,out) - the returned value of csyiqr is based on
c setting of key.
*deck,csyget
function csyget (ncsy,csydpx,csyinx)
c *** primary function: get a coordinate system
c *** secondary functions: none
c NOTE: As a time-saving device, this routine will not fetch the coordinate
c system data from the database (an expensive operation)
c if ncsy = csyinx(4), as this would indicate that the data is current.
c If you wish to force this routine to fetch coordinate system data (in
c the case of loading a local array, for example), you MUST set
c ncsy != csyinx(4) before function call.
c input arguments:
c variable (typ,siz,intent) description csycom name
c ncsy (int,sc,in) - coordinate system number
c csyinx(4) (int,sc,inout) - coordinate system number csyact
c output arguments:
c csydpx (dp,ar(18),out)
c csydpx(1-9) - transformation matrix
c (10-12) - origin (XC, YC, ZC)
c (13-14) - coordinate system parameters cparm
c cparm2
c (15) - spare
c (16-18) - defining angles
c csyinx (int,ar(6),out)
c csyinx(1-2) - theta, phi singularity keys
c (3) - coordinate system type icdsys
c (csyinx(4) is inout) (4) - coordinate system number csyact
c (5) - spare
c (6) - spare
c csyget (int,func,out) - status of coordinate system
c = 0 - coordinate system exists
c = 1 - coordinate system doesn't exist
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
208 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.6.1. cpinqr Function (Getting Information About a Coupled Set)
*deck,csyput
subroutine csyput (ncsy,csydpx,csyinx)
c *** primary function: store a coordinate system
c input arguments:
c ncsy (int,sc,in) - coordinate system number
c csydpx (dp,ar(18),out)
c csydpx(1-9) - transformation matrix
c (10-12) - origin (XC, YC, ZC)
c (13-14) - coordinate system parameters cparm
c cparm2
c (15) - spare
c (16-18) - defining angles
c csyinx (int,ar(6),out)
c csyinx(1-2) - theta, phi singularity keys
c (3) - coordinate system type icdsys
c (4) - coordinate system number csyact
c (5) - spare
c (6) - spare
*deck,csydel
subroutine csydel (ncsy)
c *** primary function: delete a coordinate system
c *** secondary functions: none
c
c typ=int,dp,log,chr,dcp siz=sc,ar(n),func intent=in,out,inout
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c input arguments:
c variable (typ,siz,intent) description
c ncsy (int,sc,in) - coordinate system number
c
c output arguments:
c none
c
*deck,cpinqr
function cpinqr (nce,key)
c *** primary function: get information about a coupled set
c *** secondary functions: none
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c typ=int,dp,log,chr,dcp siz=sc,ar(n),func intent=in,out,inout
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 209
Chapter 7: Accessing the ANSYS Database
c
c input arguments:
c variable (typ,siz,intent) description
c nce (int,sc,in) - coupled set number
c key (int,sc,in) - inquiry key:
c should be zero for key=11, DB_NUMDEFINED,
c DB_NUMSELECTED, DB_MAXDEFINED, and
c DB_MAXRECLENG
c = DB_SELECTED - return select status
c cpinqr = 1 - coupled set is selected
c = 0 - coupled set in undefined
c =-1 - coupled set in unseleted
c = DB_NUMDEFINED - return number of defined coupled sets
c = DB_NUMSELECTED - return number of selected coupled sets
c = DB_MAXDEFINED - return the number of the highest numbered
c coupled set
c = DB_MAXRECLENG - return length of largest coupled set record
c (max record length)
c = 2 - return length (data units)
c = 3 - return layer number
c = 4 - return address of first data word
c = 11 - return void percent (integer)
c = 16 - return location of next record
c = -1 - return master node for this eqn (this is
c currently only used by solution DB object)
c
c output arguments:
c cpinqr (int,func,out) - the returned value of cpinqr is based on
c setting of key
c
*deck,cpget
function cpget (ncp,ieqn)
c *** primary function: get a coupled set
c input arguments:
c ncp (int,sc,in) - coupled set number
c
c output arguments:
c cpget (int,func,out) - number of nodes in list
c ieqn (int,ar(cpget+2),out) - coupled set info:
c ieqn(1:cpget) - list of coupled nodes
c ieqn(cpget+1) - set degree of freedom
c ieqn(cpget+2) - number of nodes in list
c (copy of return value)
*deck,cpput
subroutine cpput (ncp,n,ieqn)
c *** primary function: store a coupling set
c input arguments:
c ncp (int,sc,in) - coupled set number
c n (int,sc,in) - number of nodes in coupled set
c ieqn (int,ar(n+2),in) - info for storage
c ieqn(1:n) - list of coupled nodes
c ieqn(n+1) - degree of freedom label for set
c (ieqn(n+2) is inout) ieqn(n+2) - number of nodes in coupled set
c (copy of n)
c output arguments:
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
210 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.6.6. ceget Function (Getting an Constraint Equation)
*deck,cpsel
subroutine cpsel (ncpi,ksel)
c *** primary function: select or delete a coupled set
c *** secondary functions: none
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c typ=int,dp,log,chr,dcp siz=sc,ar(n),func intent=in,out,inout
c
c input arguments:
c variable (typ,siz,intent) description
c ncpi (int,sc,in) - coupled set number
c ksel (int,sc,in) - select/delete flag
c = 0 - delete coupled set
c = 1 - select coupled set
c output arguments:
c none
c
*deck,ceinqr
function ceinqr (nce,key)
c *** primary function: get information about a constraint equation set
c input arguments:
c nce (int,sc,in) - constraint equation number
c key (int,sc,in) - inquiry key:
c should be zero for key=11, DB_NUMDEFINED,
c DB_NUMSELECTED, DB_MAXDEFINED, and
c DB_MAXRECLENG
c = DB_SELECTED - return select status
c ceinqr = 1 - equation is selected
c = 0 - equation is undefined
c =-1 - equation is unselected
c = DB_NUMDEFINED - return number of defined contraint equations
c = DB_NUMSELECTED - return number of selected contraint equations
c = DB_MAXDEFINED - return number of highest numbered constraint
c equation defined
c = DB_MAXRECLENG - return length of longest contraint equation set
c (max record length)
c = 2 - return length (data units)
c = 3 - return layer number
c = 4 - address of first data word
c = 11 - return void percent (integer)
c = 16 - return location of next record
c = -1 - return master dof for this eqn
c output arguments:
c ceinqr (int,func,out) - the returned value of ceinqr is based on
c setting of key
*deck,ceget
function ceget (nce,ieqn,deqn)
c *** primary function: get a constraint equation
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 211
Chapter 7: Accessing the ANSYS Database
c input arguments:
c nce (int,sc,in) - constraint equation number
c output arguments:
c ceget (int,func,out) - number of dof in equation
c ieqn (int,ar(ceget+1),out) - integer info
c ieqn(1:ceget) - list of node*32+dof
c ieqn(ceget+1) - number of dof in equation
c (copy of return value)
c - negative means internal CE
c deqn (dp,ar(ceget+1),out) - dp info
c deqn(1:ceget) - list of coefficients
c deqn(ceget+1) - constant term
*deck,ceput
subroutine ceput (nce,n,ieqn,deqn)
c *** primary function: store a constraint equation
c input arguments:
c nce (int,sc,in) - constraint equation set number
c n (int,sc,in) - number of degrees of freedom in set
c ieqn (int,ar(n+1),in) - integer info
c ieqn(1:n) - node*32+dof for each dof in set
c ieqn(n+1) - number of dof in set (copy of n above)
c - negative means internal CE
c deqn (dp,ar(n+1),in) - dp info
c deqn(1:n) - coefficients of each dof in set
c deqn(n+1) - constant term
c
c output arguments: none
*deck,cesel
subroutine cesel (ncei,ksel)
c *** primary function: select or delete a constraint equation
c input arguments:
c ncei (int,sc,in) - constraint equation number
c ksel (int,sc,in) - select/delete flag
c = 0 - delete equation
c = 1 - select equation
*deck,disiqr
function disiqr (node,key)
c *** primary function: get information about constraints
c input arguments:
c node (int,sc,in) - node number for inquire.
c key (int,sc,in) - key as to the information needed
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
212 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.7.4. disdel Subroutine (Deleting a Constraint at a Node)
c output arguments:
c disiqr (int,func,out) - the returned value of disiqr is based on
c setting of key.
*deck,disget
function disget (inode,idf,value)
c *** primary function: get a constraint from the data base (in raw form)
c output arguments:
c disget (int,func,out) - status of constraint.
c = 0 - no constraint on this node
c for this DOF
c = 4 - this node has a constraint
c defined for this DOF
c = -4 - this node has a pseudo-support
c defined for this DOF
c value (dp,ar(4),out) - constraint values
c value(1-2) - (real,imag) values of present settings
c value(3-4) - (real,imag) values of previous settings
*deck,disput
subroutine disput (node,idf,value)
c *** primary function: store a constraint at a node.
c input arguments:
c node (int,sc,in) - node number
c idf (int,sc,in) - reference number of DOF: (1-32)
c UX = 1, UY = 2, UZ = 3, ROTX= 4, ROTY= 5, ROTZ= 6, AX = 7, AY = 8
c AZ = 9, VX =10, VY =11, VZ =12
c PRES=19, TEMP=20, VOLT=21, MAG =22, ENKE=23, ENDS=24
c EMF =25, CURR=26 (missing entries are spares)
*deck,disdel
subroutine disdel (node,idf)
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 213
Chapter 7: Accessing the ANSYS Database
c input arguments:
c node (int,sc,in) - node number.
c idf (int,sc,in) - reference number of DOF: (1-32)
c UX = 1, UY = 2, UZ = 3, ROTX= 4, ROTY= 5, ROTZ= 6, AX = 7, AY = 8
c AZ = 9, VX =10, VY =11, VZ =12
c PRES=19, TEMP=20, VOLT=21, MAG =22, ENKE=23, ENDS=24
c EMF =25, CURR=26 (missing entries are spares)
*deck,foriqr
function foriqr (node,key)
c *** primary function: get information about nodal loads.
c input arguments:
c node (int,sc,in) - number of node being inquired about.
c should be 0 for key=DB_MAXDEFINED or
c DB_NUMDEFINED
c key (dp,sc,in) - key as to information needed
c = 1 - return force mask for node
c = DB_MAXDEFINED,
c DB_NUMDEFINED - return number of nodal loadings
c in model
c NOTE: both DB_MAXDEFINED and DB_NUMDEFINED
c produce the same functionality
c output arguments:
c foriqr (int,func,out) - the returned value of foriqr is based on
c setting of key.
*deck,forget
function forget (inode,idf,value)
c *** primary function: get a force from the data base (in raw form)
c input arguments:
c inode (int,sc,in) - node number (negative value for no
c partabeval)
c idf (int,sc,in) - reference number for the DOF: (1-32)
c (see echprm.inc)
c output arguments:
c forget (int,func,out) - status of constraint.
c = 0 - no loading on this node for this DOF
c = 4 - this node has a loading for this DOF
c value (dp,ar(4),out)
c value(1-2) - (real,imag) values of present settings
c value(3-4) - (real,imag) values of previous settings
*deck,forput
subroutine forput (node,idf,value)
c *** primary function: store a nodal load at a node
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
214 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.7.9. ntpiqr Function (Getting Information About a Nodal Temperature)
c input arguments:
c node (int,sc,in) - node number
c idf (int,sc,in) - reference number for the DOF: (1-32)
c FX = 1, FY = 2, FZ = 3, MX = 4, MY = 5, MZ = 6, CSGX= 7, CSGY= 8
c CSGZ= 9, VFX =10, VFY =11, VFZ =12
c FLOW=19, HEAT=20, AMPS=21, FLUX=22, NPKE=23, NPDS=24
c CURT=25, VLTG=26 (missing entries are spares)
*deck,fordel
subroutine fordel (node,idf)
c *** primary function: delete a nodal load at a node
c *** secondary functions: none.
c input arguments:
c variable (typ,siz,intent) description
c node (int,sc,in) - node number
c idf (int,sc,in) - reference number for the DOF: (1-32)
c FX = 1, FY = 2, FZ = 3, MX = 4, MY = 5, MZ = 6, CSGX= 7, CSGY= 8
c CSGZ= 9, VFX =10, VFY =11, VFZ =12
c FLOW=19, HEAT=20, AMPS=21, FLUX=22, NPKE=23, NPDS=24
c CURT=25, VLTG=26 (missing entries are spares)
c output arguments:
c none.
*deck,ntpiqr
function ntpiqr (node,key)
c *** primary function: get information about a nodal temperature
c input arguments:
c variable (typ,siz,intent) description
c node (int,sc,in) - node number
c should be zero for key=2
c key (int,sc,in) - key for operation
c = 1 - return temperature status
c ntpiqr = 0 - node has no temperature
c constraint defined
c = 1 - node has a temperature
c constraint defined
c = 2 - return total number of nodal
c temperatures defined in model
c output arguments:
c ndinqr (int,func,out) - the returned value of ndinqr is based on
c setting of key.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 215
Chapter 7: Accessing the ANSYS Database
*deck,ntpget
function ntpget (node,tmp)
c *** primary function: get specified nodal heat generation (in raw form)
c input arguments:
c node (int,sc,in) - node number
c output arguments:
c ntpget (int,func,out) - heat generation status of node.
c = 0 - nodal heat generation undefined
c = 1 - nodal heat generation is defined
c tmp (dp,ar(2),out) - the nodal heat generation (new,old).
*deck,ntpput
subroutine ntpput (node,temp)
c *** primary function: store nodal temperature.
c input arguments:
c node (int,sc,in) - node number
c temp (dp ,sc,in) - nodal temperature
*deck,ntpdel
subroutine ntpdel (node)
c *** primary function: delete node temperatures.
*deck,nhgiqr
function nhgiqr (node,key)
c *** primary function: get information about nodal heat generations
c input arguments:
c variable (typ,siz,intent) description
c node (int,sc,in) - node number
c should be 0 for key=2
c key (int,sc,in) - key for operation
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
216 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.7.17. nfuiqr Function (Getting Information About Nodal Fluences)
c output arguments:
c nhgiqr (int,func,out) - the returned value of nhgiqr is based on
c setting of key.
*deck,nhgget
function nhgget (node,hg)
c *** primary function: get specified nodal heat generation (in raw form)
c input arguments:
c variable (typ,siz,intent) description
c node (int,sc,in) - node number
c output arguments:
c nhgget (int,func,out) - heat generation status of node.
c = 0 - nodal heat generation undefined
c = 1 - nodal heat generation is defined
c hg (dp,ar(2),out) - the nodal heat generation (new,old).
*deck,nhgput
subroutine nhgput (node,hg)
c *** primary function: store nodal heat generation.
c input arguments:
c node (int,sc,in) - node number
c hg (dp ,sc,in) - nodal heat generation
*deck,nhgdel
subroutine nhgdel (node)
c *** primary function: delete nodal heat generations.
c output arguments:
c none.
*deck,nfuiqr
function nfuiqr (node,key)
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 217
Chapter 7: Accessing the ANSYS Database
c input arguments:
c variable (typ,siz,intent) description
c node (int,sc,in) - node number
c should be zero for key=2
c key (int,sc,in) - key for operation
c = 1 - return status:
c nfuiqr = 0 - node does not have a fluence constraint
c = 1 - node has a fluence constraint
c = 2 - return total number of nodal fluences defined on
c model
c output arguments:
c nfuiqr (int,func,out) - the returned value of nfuiqr is based on
c setting of key.
*deck,nfuget
function nfuget (node,fluen)
c *** primary function: get specified nodal fluence.
c input arguments:
c node (int,sc,in) - node number
c output arguments:
c nfuget (int,func,out) - fluence status of node.
c = 0 - node has no fluence constraint
c = 1 - node has a fluence constaint
c fluen (dp ,ar(2),out) - the nodal fluences (new,old).
*deck,nfuput
subroutine nfuput (node,fluen)
c *** primary function: store nodal fluence.
c input arguments:
c node (int,sc,in) - node number
c fluen (dp ,sc,in) - nodal fluence
*deck,nfudel
subroutine nfudel (node)
c *** primary function: delete node fluences.
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c typ=int,dp,log,chr,dcp siz=sc,ar(n),func intent=in,out,inout
c
c input arguments:
c variable (typ,siz,intent) description
c node (int,sc,in) - node number
c
c output arguments:
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
218 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.7.24. ndcdel Subroutine (Deleting a Nodal Current Density)
c none.
c
*deck,ndciqr
function ndciqr (node,key)
c *** primary function: get information about nodel current densities
c input arguments:
c variable (typ,siz,intent) description
c node (int,sc,in) - node number
c should be zero for key=2
c key (int,sc,in) - key for operation
c = 1 - return nodal current status:
c ndciqr = 0 - no current density defined for this node
c = 1 - node has a current density defined
c = 2 - total number of nodal current densities defined
c on model
c output arguments:
c ndciqr (int,func,out) - the returned value of ndciqr is based on
c setting of key.
*deck,ndcget
function ndcget (node,currd)
c *** primary function: get specified nodal current density.
c input arguments:
c node (int,sc,in) - node number
c output arguments:
c ndcget (int,func,out) - current density status of node.
c = 0 - node has no current density defined
c = 1 - node has a current density defined
c currd (dp,ar(4,2),out) - the node current density (new,old).
*deck,ndcput
subroutine ndcput (node,currd)
c *** primary function: store nodal current density.
c input arguments:
c node (int,sc,in) - node number
c currd (dp ,ar(4),in) - nodal current densities
*deck,ndcdel
subroutine ndcdel (node)
c *** primary function: delete nodal current densities
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 219
Chapter 7: Accessing the ANSYS Database
7.7.25. nvdiqr Function (Getting Information About Nodal Magnetic Virtual Displacements)
*deck,nvdiqr
function nvdiqr (node,key)
c *** primary function: get information about nodal mag virtual disps
c input arguments:
c variable (typ,siz,intent) description
c node (int,sc,in) - node number
c should be zero for key=2
c key (int,sc,in) - key for operation
c = 1 - return magnetic virtual displacement status
c nvdiqr = 0 - no mag. virt. disps defined for this node
c = 1 - node has mag. virt. disps defined
c = 2 - return total number of nodal magnetic virtual
c displacements defined on model
c output arguments
c nvdiqr (int,func,out) - the returned value of nvdiqr is based on
c setting of key.
*deck,nvdget
function nvdget (node,virtd)
c *** primary function: get specified nodal magnetic virtual displacement
c input arguments:
c node (int,sc,in) - node number
c output arguments:
c nvdget (int,func,out) - virtual disp status of node.
c = 0 - node has no magnetic virtual
c displacement
c = 1 - node has a magnetic virtual
c displacement
c virtd (dp ,sc,out) - the nodal virtual displacement value
*deck,nvdput
subroutine nvdput (node,virtd)
c *** primary function: store nodal virtual displacement
c input arguments:
c node (int,sc,in) - node number
c virtd (dp ,sc,in) - nodal virtual displacement
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
220 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.8.2. eprget Function (Getting an Element Face Pressure)
*deck,nvddel
subroutine nvddel (node)
c *** primary function: delete nodal virtual displacements.
*deck,epriqr
function epriqr (ielem,iface,key)
c *** primary function: get information about element pressure/convection
c input arguments:
c ielem (int,sc,in) - element number
c should be zero for key=DB_NUMDEFINED or
c DB_MAXRECLENG
c iface (int,sc,in) - face number for inquire (0-6)
c face number is needed for key=5. for
c other values of key, iface has different
c meaning (see below)
c key (int,sc,in) - key as to the information needed
c = 1 - return pressure mask for element
c = 5 - return number of pressures for this
c element face
c = DB_NUMDEFINED,
c = DB_MAXDEFINED - return value is based on setting of iface
c NOTE: both DB_NUMDEFINED and
c DB_MAXDEFINED produce the same
c functionality
c iface = 0 - return number of surface loads defined
c = 1-6 - return number of pressure loads
c defined for this element.
c NOTE: only 1-6 is valid, but this
c routine simply checks that iface is in
c the range. The actual value of iface
c does not matter in this case.
c = DB_MAXRECLENG - return the maximum number of element
c pressures on any element (max record
c length)
c output arguments:
c epriqr (int,func,out) - the returned value of epriqr is based on
c setting of key.
*deck,eprget
function eprget (elem,iface,value)
c *** primary function: get an element face pressure
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 221
Chapter 7: Accessing the ANSYS Database
c input arguments:
c elem (int,sc,in) - element number (negative value for
c no partabeval)
c iface (int,sc,in) - face number (1-6)
c output arguments:
c eprget (int,func,out) - status of element.
c =-1 - element has no pressures
c = 0 - this element face has no pressures
c > 0 - number of values defined
c value (dp ,ar(*),out) - the element pressures (real,imag) at each
c face
*deck,eprput
subroutine eprput (ielem,iface,nval,value)
c *** primary function: store an element face pressure.
c input arguments:
c ielem (int,sc,in) - element number for operation.
c iface (int,sc,in) - face number (1-6)
c nval (int,sc,in) - number of values to put
c value (dp ,ar(nval),in) - the element pressures (real,imag) at each
c face
*deck,eprdel
subroutine eprdel (ielem,iface)
c *** primary function: delete a pressure/convection on an element
c input arguments:
c ielem (int,sc,in) - element number
c iface (int,sc,in) - face number
c = 0 - delete all pressures on this
c element
c = 1-6 - delete pressure on this face
*deck,ecviqr
function ecviqr (ielem,iface,key)
c *** primary function: get information about element convections
c input arguments:
c ielem (int,sc,in) - element number for inquire
c should be zero for key=DB_NUMDEFINED or
c DB_MAXRECLENG
c iface (int,sc,in) - face number for inquire (0-6)
c face number is needed for key=5. for
c other values of key, iface has different
c meaning (see below)
c key (int,sc,in) - key as to the information needed
c = 1 - return convection mask for element
c = 5 - return number of convections for this
c element face
c = DB_NUMDEFINED,
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
222 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.8.7. ecvput Subroutine (Storing an Element Face Convection)
c output arguments:
c ecviqr (int,func,out) - the returned value of ecviqr is based on
c setting of key.
*deck,ecvget
function ecvget (elem,iface,value)
c *** primary function: get an element face convection (in raw form)
c input arguments:
c elem (int,sc,in) - element number
c iface (int,sc,in) - face number (1-6)
c output arguments:
c ecvget (int,func,out) - status of element.
c =-1 - element has no convections/heat
c fluxes
c = 0 - this element face has no
c convections/heat fluxes
c > 0 - number of values defined
c value (dp ,ar(*),out) - the element convections
*deck,ecvput
subroutine ecvput (ielem,iface,nval,value)
c *** primary function: store an element face convection.
c input arguments:
c variable (typ,siz,intent) description
c ielem (int,sc,in) - element number
c iface (int,sc,in) - face number (1-6)
c nval (int,sc,in) - number of values to put
c value (dp ,ar(nval),in) - the element convections.
c NOTE: Two values at each node of an
c element face: if loading is a convection,
c the first first value is the film
c coefficient and the second value is the
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 223
Chapter 7: Accessing the ANSYS Database
*deck,ecvdel
subroutine ecvdel (ielem,iface)
c *** primary function: delete a convection on an element
c input arguments:
c variable (typ,siz,intent) description
c ielem (int,sc,in) - element number.
c iface (int,sc,in) - face number
c = 0 - delete all convections on this
c element
c = 1-6 - delete convections on this face
c output arguments:
c none.
*deck,etpiqr
function etpiqr (ielem,key)
c *** primary function: get information about element temperatures.
c input arguments:
c ielem (int,sc,in) - element number
c Should be 0 for key=11, DB_NUMDEFINED,
c DB_MAXDEFINED, and DB_MAXRECLENG
c key (int,sc,in) - information flag.
c = DB_SELECTED - return status:
c etpiqr = 0 - element has no temperatures
c = 1 - element has temperatures defined
c = DB_NUMDEFINED - return number of temperatures defined for
c this element (rec length)
c = DB_MAXDEFINED - return number of temperatures defined in
c model
c = DB_MAXRECLENG - return maximum number of temperatures
c defined for any element (max rec length)
c = 2 - return length (dp words)
c = 3 - return layer number (for cross reference files return
c number of entities)
c = 4 - return address of first data word
c = 5 - return length (dp words)
c = 6 - return compressed record number.
c = 11 - return void percent (integer)
c = 16 - return location of next record (this increments the
c next record count)
c = 18 - return type of file.
c etpiqr = 0 - integer
c = 1 - double precision
c = 2 - real
c = 3 - complex
c = 4 - character*8
c = 7 - index
c = 19 - return virtual type of file.
c etpiqr = 0 - fixed length (4.4 form)
c = 1 - indexed variable length
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
224 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.8.12. etpdel Subroutine (Deleting an Element Temperature)
c (layer data)
c = 2 - xref data tables
c = 3 - bitmap data (for 32 data item packed
c records)
c = 4 - data tables (three dimensional arrays)
c output arguments:
c etpiqr (int,func,out) - the returned value of etpiqr is based on
c setting of key.
*deck,etpget
function etpget (ielem,tem)
c *** primary function: get element temperatures (in raw form)
c input arguments:
c ielem (int,sc,in) - element number
c output arguments:
c etpget (int,func,out) - status of element.
c = 0 - this element has no element
c temperatures
c > 0 - number of element temperatures
c retrieved
c tem (dp,ar(n,2),out) - the element temperatures (new,old).
*deck,etpput
subroutine etpput (ielem,n,temp)
c *** primary function: store element temperatures.
c input arguments:
c ielem (int,sc,in) - element number
c n (int,sc,in) - number of element temperature values
c temp (dp ,ar(n),in) - element temperatures.
*deck,etpdel
subroutine etpdel (ielem)
c *** primary function: delete element temperatures.
c input arguments:
c ielem (int,sc,in) - element number
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 225
Chapter 7: Accessing the ANSYS Database
*deck,ehgiqr
function ehgiqr (ielem,key)
c *** primary function: get information about element heat generations.
c input arguments:
c ielem (int,sc,in) - element number
c should be 0 for key=11, DB_NUMDEFINED,
c DB_MAXDEFINED, and DB_MAXRECLENG
c key (int,sc,in) - information flag.
c = DB_SELECTED - return status:
c ehgiqr = 0 - heat generation is undefined
c = 1 - heat generation is defined
c = DB_NUMDEFINED - return number of defined heat generations
c in model
c = DB_MAXRECLENG - return maximum number of heat generations
c on any element (max rec length)
c = 2 - return length (dp words)
c = 3 - return layer number (for cross reference files return
c number of entities)
c = 4 - return address of first data word
c = 5 - return length (record type units)
c = 6 - return compressed record number.
c = 11 - return void percent (integer)
c = 16 - return location of next record (this increments the
c next record count)
c = 18 - return type of file.
c ehgiqr = 0 - integer
c = 1 - double precision
c = 2 - real
c = 3 - complex
c = 4 - character*8
c = 7 - index
c = 19 - return virtual type of file.
c ehgiqr = 0 - fixed length (4.4 form)
c = 1 - indexed variable length
c (layer data)
c = 2 - xref data tables
c = 3 - bitmap data (for 32 data
c item packed records)
c = 4 - data tables (three
c dimensional arrays)
c output arguments:
c ehgiqr (int,func,out) - the returned value of ehgiqr is based on
c setting of key.
*deck,ehgget
function ehgget (ielem,qgen)
c *** primary function: get element heat generations (in raw form)
c input arguments:
c ielem (int,sc,in) - element number
c output arguments:
c ehgget (int,func,out) - status of element.
c = 0 - heat generations undefined for this
c element
c > 0 - number of heat generations defined
c qgen (dp ,ar(*),out) - the element heat generations.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
226 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.8.17. efuiqr Function (Getting Information About Element Fluences)
*deck,ehgput
subroutine ehgput (ielem,n,qgen)
c *** primary function: store element heat generations
c input arguments:
c ielem (int,sc,in) - element number
c n (int,sc,in) - number of element heat generation values
c qgen (dp ,ar(n),in) - element heat generations
*deck,ehgdel
subroutine ehgdel (ielem)
c *** primary function: delete element heat generations.
c input arguments:
c variable (typ,siz,intent) description
c ielem (int,sc,in) - element number
c output arguments:
c none
*deck,efuiqr
function efuiqr (ielem,key)
c *** primary function: get information about element fluences
c input arguments:
c ielem (int,sc,in) - element number or zero (see below)
c key (int,sc,in) - key as to the information needed
c = 1 or DB_MAXRECLENG - return element fluences info
c for ielem > 0 - return number of fluences for this
c element (record length)
c = 0 - return maximum number of fluences
c defined for any element
c (max rec length)
c = DB_NUMDEFINED,
c = DB_MAXDEFINED - return number of defined fluences
c in model
c NOTE: both DB_NUMDEFINED and DB_MAXDEFINED
c produce the same functionality
c output arguments:
c efuiqr (int,func,out) - the returned value of efuiqr is based on
c setting of key
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 227
Chapter 7: Accessing the ANSYS Database
*deck,efuget
function efuget (ielem,value)
c *** primary function: get element fluences.
c input arguments:
c ielem (int,sc,in) - element number
c output arguments:
c efuget (int,func,out) - status of element.
c = 0 - element has no fluences defined
c > 0 - number of element fluences defined
c value (dp,ar(*),out) - element fluences.
*deck,efuput
subroutine efuput (ielem,n,value)
c *** primary function: store element fluences
c input arguments:
c ielem (int,sc,in) - element number
c n (int,sc,in) - the number of values to store
c value (dp,ar(n),in) - element fluences.
*deck,efudel
subroutine efudel (ielem)
c *** primary function: delete element fluences
*deck,edciqr
function edciqr (ielem,key)
c *** primary function: get information about element current densities
c input arguments:
c ielem (int,sc,in) - element number or zero (see below)
c key (int,sc,in) - key as to the information needed
c = 1 or DB_MAXRECLENG - return element densities info
c for ielem > 0 - number of current densities for this
c element (rec length)
c = 0 - maximum number of current densities
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
228 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.8.24. edcdel Subroutine (Deleting an Element Current Density)
c output arguments:
c edciqr (int,func,out) - the returned value of edciqr is based on
c setting of key
*deck,edcget
function edcget (ielem,value)
c *** primary function: get element current densities
*deck,edcput
subroutine edcput (ielem,n,value)
c *** primary function: store element current densities
c input arguments:
c ielem (int,sc,in) - element number
c n (int,sc,in) - the number of current densities to store
c value (dp,ar(n),in) - element current densities
c output arguments:
c none
c NOTE: If a value is not defined, a very
c small number should be used (2**-100)
*deck,edcdel
subroutine edcdel (ielem)
c *** primary function: delete element current densities
c input arguments:
c ielem (int,sc,in) - element number
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 229
Chapter 7: Accessing the ANSYS Database
*deck,evdiqr
function evdiqr (ielem,key)
c *** primary function: get information about element virt disps
c input arguments:
c ielem (int,sc,in) - element number or zero (see below)
c key (int,sc,in) - key as to the information needed
c = 1 or DB_MAXRECLENG - return element virt disps info
c for ielem > 0 - number of virt disps defined for this
c element (rec length)
c = 0 - maximum number of virt disps defined
c for any element (max rec length)
c = DB_NUMDEFINED,
c = DB_MAXDEFINED - return total number of virt disps defined
c in model
c NOTE: both DB_NUMDEFINED and DB_MAXDEFINED
c produce the same functionality
c output arguments:
c evdiqr (int,func,out) - the returned value of evdiqr is based on
c setting of key
*deck,evdget
function evdget (ielem,value)
c *** primary function: get element virtual displacements
c input arguments:
c ielem (int,sc,in) - element number
c
c output arguments:
c evdget (int,func,out) - status of element.
c = 0 - no virt disps defined for this
c element
c > 0 - number of element virtual
c displacements
c value (dp,ar(*),out) - element virtual displacements
c
c NOTE: If a value is not defined, it will
c be a very small number (2**-100)
*deck,evdput
subroutine evdput (ielem,n,value)
c *** primary function: store element virtual displacements
c input arguments:
c ielem (int,sc,in) - element number
c n (int,sc,in) - the total number of values
c value (dp,ar(n),in) - element virtual displacments
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
230 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.8.30. eimput Subroutine (Storing an Element Impedance)
*deck,eimiqr
function eimiqr (ielem,iface,key)
c *** primary function: get information about element impedences
c input arguments:
c ielem (int,sc,in) - element number for inquire.
c should be zero for key=DB_NUMDEFINED,
c DB_MAXDEFINED or DB_MAXRECLENG
c iface (int,sc,in) - face number for inquire (0-6)
c face number is needed for key=5. for
c other values of key, iface has different
c meaning (see below)
c key (int,sc,in) - key as to the information needed
c = 1 - return impedence mask for element
c = 5 - return number of impedences for this
c element face
c = DB_NUMDEFINED,
c = DB_MAXDEFINED - return value is based on setting of iface
c NOTE: both DB_NUMDEFINED and
c DB_MAXDEFINED produce the same
c functionality
c iface = 0 - return number of surface loads defined
c in model
c = 1-6 - return number of pressure loads
c defined for this element. (rec length)
c NOTE: only 1-6 is valid, but this
c routine simply checks that iface is in
c the range. The actual value of iface
c does not matter in this case.
c = DB_MAXRECLENG - return the maximum number of element
c impedences defined for any element
c (max rec length)
c output arguments:
c eimiqr (int,func,out) - the returned value of eimiqr is based on
c setting of key.
*deck,eimget
function eimget (ielem,iface,value)
c *** primary function: get an element face impedance
c input arguments:
c ielem (int,sc,in) - element number
c iface (int,sc,in) - face number (1-6)
c output arguments:
c eimget (int,func,out) - status of element.
c =-1 - element has no impedances
c = 0 - this element face has no impedances
c > 0 - number of values defined
c value (dp ,ar(*),out) - the element impedances (real,imag)
*deck,eimput
subroutine eimput (ielem,iface,nval,value)
c *** primary function: store an element face impedance.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 231
Chapter 7: Accessing the ANSYS Database
c input arguments:
c ielem (int,sc,in) - element number
c iface (int,sc,in) - face number (1-6)
c nval (int,sc,in) - number of values to put
c value (dp ,ar(nval),in) - the element impedances (real,imag)
*deck,eimdel
subroutine eimdel (ielem,iface)
c *** primary function: delete an impedance on a element
c input arguments:
c ielem (int,sc,in) - element number
c iface (int,sc,in) - face number
c = 0 - delete all impedances on this
c element
c = 1-6 - delete impedance on this face
7.8.32. esfiqr Function (Getting Information About Element Surface Stress Data)
*deck,esfiqr
function esfiqr (ielem,key)
c *** primary function: get information about element surface stress data
c input arguments:
c ielem (int,sc,in) - element number (or zero, see below)
c key (int,sc,in) - key as to the information needed
c = 1 - return info about surface stress
c ielem > 0 - return number of surface stresses on this
c element (rec length)
c = 0 - return maximum number of surface stresses
c on any element (max rec length)
c = DB_NUMDEFINED - return the number of surface stresses
c defined in model
c output arguments:
c esfiqr (int,func,out) - the returned value of esfiqr is based on
c setting of key
*deck,esfget
function esfget (ielem,value)
c *** primary function: get element surface stress data.
c input arguments:
c ielem (int,sc,in) - element number
c output arguments:
c esfget (int,func,out) - status of element.
c = 0 - element undefined
c > 0 - number of values returned
c value (dp,ar(*),out) - element surface stress data.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
232 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.8.37. efsget function (Getting Element Face Flagged Surfaces)
*deck,esfput
subroutine esfput (ielem,nval,value)
c *** primary function: store surface stresses for an element.
c input arguments:
c ielem (int,sc,in) - element number
c nval (int,sc,in) - the total number of values
c (19 * number of stress faces)
c There is a max of 2 stress faces
c value (dp,ar(nval),in) - the values
*deck,esfdel
subroutine esfdel (ielem)
c *** primary function: delete element surface stress data
c input arguments:
c ielem (int,sc,in) - element number
c = 0 - delete for all defined elements
*deck,efsdel
subroutine efsdel (ielem,iface)
c *** primary function: delete a flagged surface on an element
c input arguments:
c ielem (int,sc,in) - element number
c iface (int,sc,in) - face number
c = 0 - all flagged surfaces
c = 1-6 - this flagged surface
*deck,efsget
function efsget (ielem,iface,value)
c *** primary function: get element face flagged surfaces
c input arguments:
c ielem (int,sc,in) - element number
c iface (int,sc,in) - face number (1-6)
c output arguments:
c efsget (int,func,out) - status of element.
c =-1 - no values for this element
c = 0 - zero flagged surfaces defined
c > 0 - number of values defined
c value (dp ,ar(*),out) - the element flagged surfaces
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 233
Chapter 7: Accessing the ANSYS Database
*deck,efsiqr
function efsiqr (ielem,iface,key)
c *** primary function: get information about flagged surfaces
c input arguments:
c ielem (int,sc,in) - element number for inquire.
c should be zero for key=DB_NUMDEFINED,
c DB_MAXDEFINED or DB_MAXRECLENG
c iface (int,sc,in) - face number for inquire (0-6)
c face number is needed for key=5. for
c other values of key, iface has different
c meaning (see below)
c key (int,sc,in) - key as to the information needed
c = 1 - return flagged surfaces mask for element
c = 5 - return number of flagged surfaces for this
c element face
c = DB_NUMDEFINED,
c = DB_MAXDEFINED - return value is based on setting of iface
c NOTE: both DB_NUMDEFINED and
c DB_MAXDEFINED produce the same
c functionality
c iface = 0 - return total number of pressures,
c convections, etc defined in model
c = 1-6 - return number of flagged surfaces
c defined for this element. (rec length)
c NOTE: only 1-6 is valid, but this
c routine simply checks that iface is in
c the range. The actual value of iface
c does not matter in this case.
c = DB_MAXRECLENG - return maximum number of flagged surfaces
c for any element (max rec length)
c output arguments:
c efsiqr (int,func,out) - the returned value of efsiqr is based on
c setting of key.
*deck,efsput
subroutine efsput (ielem,iface,nval,value)
c *** primary function: store an element face flagged surface.
c input arguments:
c ielem (int,sc,in) - element number
c iface (int,sc,in) - face number (1-6)
c nval (int,sc,in) - number of values to put
c value (dp ,ar(nval),in) - the element flagged surface values
*deck,dspiqr
function dspiqr (node,key)
c *** primary function: get information about nodal results
c input arguments:
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
234 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.9.4. dspdel Subroutine (Deleting a Result at a Node)
c output arguments:
c dspiqr (int,func,out) - the returned value of dspiqr is based on
c setting of key
*deck,dspget
function dspget (node,ndf,idf,value)
c *** primary function: get a nodal result from the data base
c input arguments:
c variable (typ,siz,intent) description
c node (int,sc,in) - node number
c ndf (int,sc,in) - number of results requested
c idf (int,ary(ndf),in) - reference number for the DOF: (1-32)
c UX = 1, UY = 2, UZ = 3, ROTX= 4, ROTY= 5, ROTZ= 6, AX = 7, AY = 8
c AZ = 9, VX =10, VY =11, VZ =12
c PRES=19, TEMP=20, VOLT=21, MAG =22, ENKE=23, ENDS=24
c EMF =25, CURR=26 SP01=27, SP02=28, SP03=29, SP04=30, SP05=31, SP06=32
c (missing entries are spares)
c output arguments:
c dspget (int,func,out) - number of actual results
c value (dp,ar(ndf),out) - result values
*deck,dspput
subroutine dspput (node,ndf,idf,value)
c *** primary function: store a result at a node.
c input arguments:
c node (int,sc,in) - node number
c ndf (int,sc,in) - number of results to be stored
c idf (int,ary(ndf),in) - reference number for the DOF: (1-32)
c value (dp,ar(ndf),in) - displacement values
*deck,dspdel
subroutine dspdel (node,ndf,idf)
c *** primary function: delete a result at a node
c input arguments:
c node (int,sc,in) - node number. (0 to delete DOF at all
c nodes)
c ndf (int,sc,in) - number of DOFs to delete (0 to delete
c all DOFs)
c idf (int,ar(*),in) - reference number for the DOF: (1-32)
c UX = 1, UY = 2, UZ = 3, ROTX= 4, ROTY= 5, ROTZ= 6, AX = 7, AY = 8
c AZ = 9, VX =10, VY =11, VZ =12
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 235
Chapter 7: Accessing the ANSYS Database
*deck,emsiqr
function emsiqr (ielem,key)
c *** primary function: get information about element misc summable data
c input arguments:
c ielem (int,sc,in) - element number (or zero, see below)
c key (int,sc,in) - key as to the information needed
c = 1 - return info about misc summed data records
c ielem > 0 - return number of misc summed
c data items for this element
c (record length)
c = 0 - return maximum number of misc
c summed data items on any
c element (max record length)
c = DB_NUMDEFINED - return total number of misc summed data
c items defined in model
c output arguments:
c emsiqr (int,func,out) - the returned value of emsiqr is based on
c setting of key
*deck,emsget
function emsget (ielem,value)
c *** primary function: get element misc summable data.
c input arguments:
c ielem (int,sc,in) - element number
c output arguments:
c emsget (int,func,out) - status of element.
c = 0 - element is undefined
c > 0 - number of data items returned
c value (dp,ar(*),out) - element misc summed data.
*deck,emsput
subroutine emsput (ielem,nval,value)
c *** primary function: store misc. summable data for an element.
c input arguments:
c ielem (int,sc,in) - element number
c nval (int,sc,in) - number of values to be stored
c value (dp,ar(nval),in) - the misc summed data values
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
236 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.9.11. enfput Subroutine (Storing an Element's Nodal Forces)
*deck,emsdel
subroutine emsdel (ielem)
c *** primary function: delete element misc summable data
c input arguments:
c ielem (int,sc,in) - element number
c = 0 - delete data for all defined elements
*deck,enfiqr
function enfiqr (ielem,key)
c *** primary function: get information about element nodal forces
c input arguments:
c ielem (int,sc,in) - element number (or zero, see below)
c key (int,sc,in) - key as to the information needed
c = 1 - return info about element nodal forces
c ielem > 0 - return number of element nodal
c forces for this element
c (record length)
c = 0 - return maximum number of element
c nodal forces on any element
c (max record length)
c = DB_NUMDEFINED - return total number of element nodal
c forces defined in model
c output arguments:
c enfiqr (int,func,out) - the returned value of enfiqr is based on
c setting of key
*deck,enfget
function enfget (ielem,value)
c *** primary function: get element nodal forces.
c input arguments:
c ielem (int,sc,in) - element number
c output arguments:
c enfget (int,func,out) - status of element.
c = 0 - element has no nodal forces
c > 0 - number of nodal forces returned
c value (dp,ar(*),out) - element nodal forces
*deck,enfput
subroutine enfput (ielem,nval,value)
c *** primary function: store nodal force results at an element.
c input arguments:
c ielem (int,sc,in) - element number
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 237
Chapter 7: Accessing the ANSYS Database
*deck,enfdel
subroutine enfdel (ielem)
c *** primary function: delete element nodal forces data
c input arguments:
c ielem (int,sc,in) - element number
c = 0 - delete for all defined elements
*deck,ensiqr
function ensiqr (ielem,key)
c *** primary function: get information about element nodal stresses
c input arguments:
c ielem (int,sc,in) - element number (or zero, see below)
c key (int,sc,in) - key as to the information needed
c = 1 - return info about element nodal stresses
c ielem > 0 - return number of element nodal
c stresses for this element
c (record length)
c = 0 - return maximum number of element
c nodal stresses on any element
c (max record length)
c = DB_NUMDEFINED - return total number of element
c nodal stresses defined in model
c output arguments:
c ensiqr (int,func,out) - the returned value of ensiqr is based on
c setting of key
*deck,ensget
function ensget (ielem,value)
c *** primary function: get element nodal stresses.
c input arguments:
c ielem (int,sc,in) - element number
c output arguments:
c ensget (int,func,out) - status of element.
c = 0 - element undefined
c > 0 - number of nodal stresses
c returned
c value (dp,ar(*),out) - element nodal stresses
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
238 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.9.15. ensput Subroutine (Storing Nodal Stresses at an Element)
c corner node
c For shell elements, stresses at each
c corner node (first top durface, then
c bottom)
c For layered elements (w/KEYOPT(8)=0),
c stresses for "first" layer at each
c corner node (first at the bottom
c surface of the bottom layer, then the
c top surface of the top layer).
c Stresses for "second" layer at each
c corner node (first the bottom surface,
c then the top surface for the layer with
c the largest failure criteria).
c The second layer is not present if
c failure criteria were not used or are
c not appropriate
c For layered elements (w/KEYOPT(8)=1),
c stresses for each layer at each corner
c node (first at the bottom surface, then
c the top surface)
c For beam elements, the contents of this
c record is element depenent. See LS
c item of ETABLE command.
*deck,ensput
subroutine ensput (ielem,nval,value)
c *** primary function: store nodal stresses at an element.
c input arguments:
c ielem (int,sc,in) - element number
c nval (int,sc,in) - the total number of values
c (6*nnod*nface)
c value (dp,ar(nval),in) - the stress values
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 239
Chapter 7: Accessing the ANSYS Database
*deck,ensdel
subroutine ensdel (ielem)
c *** primary function: delete element nodal stresses
c input arguments:
c ielem (int,sc,in) - element number
c = 0 - delete for all defined elements
*deck,engiqr
function engiqr (ielem,key)
c *** primary function: get information about element energies
c input arguments:
c ielem (int,sc,in) - element number (or zero, see below)
c key (int,sc,in) - key as to the information needed
c = 1 - return info about element energies
c ielem > 0 - return number of element energies on
c this element (rec length)
c = 0 - return maximum number of element
c energies on any element
c (max rec length)
c = DB_NUMDEFINED - return the number of element energies
c defined in model
c output arguments:
c engiqr (int,func,out) - the returned value of engiqr is based on
c setting of key
*deck,engget
function engget (ielem,value)
c *** primary function: get element energies.
c input arguments:
c ielem (int,sc,in) - element number
c output arguments:
c engget (int,func,out) - status of element.
c = 0 - element undefined
c = 11 - energies returned
c value (dp,ar(6),out)
c value(1) = volume of element
c (2) = strain energy
c (3) = dissipation energy
c (4) = kinetic energy
c (5) = plastic energy
c (6) = creep energy
c (7) = stabilization energy
c (8) = spares
c (9) = thermal energy
c (10-11) = spares
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
240 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.9.21. egriqr Function (Getting Information About an Element's Nodal Gradients)
*deck,engput
subroutine engput (ielem,nval,value)
c *** primary function: store volume and energies for an element.
c input arguments:
c ielem (int,sc,in) - element number
c nval (int,sc,in) - the total number of values to be stored
c Must be 11!
c value (dp,ar(6),in) - volume and energies
c value(1) = volume of element
c (2) = strain energy
c (3) = dissipation energy
c (4) = kinetic energy
c (5) = plastic energy
c (6) = creep energy
c (7) = stabilization energy
c (8) = spares
c (9) = thermal energy
c (10-11) = spares
*deck,engdel
subroutine engdel (ielem)
c *** primary function: delete element energies
c input arguments:
c ielem (int,sc,in) - element number
c = 0 - delete for all defined elements
*deck,egriqr
function egriqr (ielem,key)
c *** primary function: get information about element nodal gradients
c input arguments:
c ielem (int,sc,in) - element number (or zero, see below)
c key (int,sc,in) - key as to the information needed
c = 1 - return info about nodal gradients
c for ielem > 0 - return number of nodal gradients on
c this element (record length)
c = 0 - return maximum number of nodal
c gradients on any element
c (maximum record length)
c = DB_NUMDEFINED - return the number of nodal gradients defined
c in model
c output arguments:
c egriqr (int,func,out) - the returned value of egriqr is based on
c setting of key
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 241
Chapter 7: Accessing the ANSYS Database
*deck,egrget
function egrget (ielem,value)
c *** primary function: get element nodal gradients.
c input arguments:
c ielem (int,sc,in) - element number
c output arguments:
c egrget (int,func,out) - status of element.
c = 0 - element undefined
c > 0 - number of nodal gradients
c returned
c value (dp,ar(*),out) - element nodal gradients
*deck,egrput
subroutine egrput (ielem,nval,value)
c *** primary function: store nodal gradients at an element.
c input arguments:
c ielem (int,sc,in) - element number
c nval (int,sc,in) - the total number of values
c (ndir*nnod*nscalr)
c value (dp,ar(nval),in) - the gradient values
*deck,egrdel
subroutine egrdel (ielem)
c *** primary function: delete element nodal gradients
c input arguments:
c ielem (int,sc,in) - element number
c = 0 - delete for all defined elements
7.9.25. eeliqr Function (Getting Information About an Element's Nodal Elastic Strains)
*deck,eeliqr
function eeliqr (ielem,key)
c *** primary function: get information about element nodal elastic strains
c input arguments:
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
242 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.9.27. eelput Subroutine (Storing an Element's Nodal Elastic Strains)
c output arguments:
c eeliqr (int,func,out) - the returned value of eeliqr is based on
c setting of key
*deck,eelget
function eelget (ielem,value)
c *** primary function: get element nodal elastic strains.
c input arguments:
c ielem (int,sc,in) - element number
c output arguments:
c eelget (int,func,out) - status of element.
c = 0 - element undefined
c > 0 - number of nodal elastic strains
c returned
c value (dp,ar(*),out) - element nodal elastic strains
*deck,eelput
subroutine eelput (ielem,nval,value)
c *** primary function: store nodal elastic strains at an element.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 243
Chapter 7: Accessing the ANSYS Database
c input arguments:
c ielem (int,sc,in) - element number
c nval (int,sc,in) - the total number of values
c (6*nnod*nface)
c value (dp,ar(nval),in) - nval strain values
*deck,eeldel
subroutine eeldel (ielem)
c *** primary function: delete element elastic strains
c input arguments:
c ielem (int,sc,in) - element number
c = 0 - delete for all defined elements
7.9.29. epliqr Function (Getting Information About an Element's Nodal Plastic Strains)
*deck,epliqr
function epliqr (ielem,key)
c *** primary function: get information about element nodal plastic strains
c input arguments:
c ielem (int,sc,in) - element number (or zero, see below)
c key (int,sc,in) - key as to the information needed
c = 1 - return info about plastic strains
c ielem > 0 - return number of nodal plastic strains
c on this element
c (record length)
c = 0 - return maximum number of nodal plastic
c strains on any element
c (max record length)
c = DB_NUMDEFINED - return the number of nodal plastic strains
c defined in model
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
244 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.9.31. eplput Subroutine (Storing an Element's Nodal Plastic Strains)
c output arguments:
c epliqr (int,func,out) - the returned value of epliqr is based on
c setting of key
*deck,eplget
function eplget (ielem,value)
c *** primary function: get element nodal plastic strains.
c input arguments:
c ielem (int,sc,in) - element number
c output arguments:
c eplget (int,func,out) - status of element.
c = 0 - element undefined
c > 0 - number of nodal plastic strains
c returned
c value (dp,ar(*),out) - element nodal plastic strains
*deck,eplput
subroutine eplput (ielem,nval,value)
c *** primary function: store nodal plastic strains at a element.
c input arguments:
c ielem (int,sc,in) - element number
c nval (int,sc,in) - the total number of values
c (6*nnod*nface)
c value (dp,ar(nval),in) - the strain values
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 245
Chapter 7: Accessing the ANSYS Database
*deck,epldel
subroutine epldel (ielem)
c *** primary function: delete element plastic strains
c input arguments:
c ielem (int,sc,in) - element number
c = 0 - delete for all defined elements
7.9.33. ecriqr Function (Getting Information About an Element's Nodal Creep Strains)
*deck,ecriqr
function ecriqr (ielem,key)
c *** primary function: get information about element nodal creep strains
c input arguments:
c ielem (int,sc,in) - element number (or zero, see below)
c key (int,sc,in) - key as to the information needed
c = 1 - return info about creep strains
c ielem > 0 - return number of nodal creep strains
c on this element
c (record length)
c = 0 - return maximum number of nodal creep
c strains on any element
c (max record length)
c = DB_NUMDEFINED - return the number of nodal creep strains
c defined in model
c output arguments:
c ecriqr (int,func,out) - the returned value of ecriqr is based on
c setting of key
*deck,ecrget
function ecrget (ielem,value)
c *** primary function: get element nodal creep strains.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
246 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.9.35. ecrput Subroutine (Storing an Element's Nodal Creep Strains)
c input arguments:
c ielem (int,sc,in) - element number
c output arguments:
c ecrget (int,func,out) - status of element.
c = 0 - element undefined
c > 0 - number of nodal creep strains
c returned
c value (dp,ar(*),out) - element nodal creep strains
*deck,ecrput
subroutine ecrput (ielem,nval,value)
c *** primary function: store nodal creep strains at an element.
c input arguments:
c ielem (int,sc,in) - element number
c nval (int,sc,in) - the total number of values
c (6*nnod*nface)
c value (dp,ar(nval),in) - the strain values
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 247
Chapter 7: Accessing the ANSYS Database
*deck,ecrdel
subroutine ecrdel (ielem)
c *** primary function: delete element creep strains
c input arguments:
c ielem (int,sc,in) - element number
c = 0 - delete for all defined elements
7.9.37. ethiqr Function (Getting Information About an Element's Nodal Thermal Strains)
*deck,ethiqr
function ethiqr (ielem,key)
c *** primary function: get information about element nodal thermal strains
c input arguments:
c ielem (int,sc,in) - element number (or zero, see below)
c key (int,sc,in) - key as to the information needed
c = 1 - return info about thermal strains
c ielem > 0 - return number of nodal thermal strains
c on this element
c (record length)
c = 0 - return maximum number of nodal thermal
c strains on any element
c (max record length)
c = DB_NUMDEFINED - return the number of nodal thermal strains
c defined in model
c output arguments:
c ethiqr (int,sc,out) - the returned value of ethiqr is based on
c setting of key
*deck,ethget
function ethget (ielem,value)
c *** primary function: get element nodal thermal strains.
c also the volumetric swelling strain
c *** Notice - This file contains ANSYS Confidential information ***
c input arguments:
c ielem (int,sc,in) - element number
c output arguments:
c ethget (int,func,out) - status of element.
c = 0 - element undefined
c > 0 - number of nodal thermal strains
c returned
c value (dp,ar(*),out) - element nodal thermal strains
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
248 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.9.39. ethput Subroutine (Storing an Element's Nodal Thermal Stresses)
*deck,ethput
subroutine ethput (ielem,nval,value)
c *** primary function: store nodal thermal strains at an element.
c also the volumetric swelling strain
c input arguments:
c ielem (int,sc,in) - element number
c nval (int,sc,in) - the total number of values
c (6*nnod*nface)
c value (dp,ar(nval),in) - the strain values
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 249
Chapter 7: Accessing the ANSYS Database
7.9.40. ethdel Subroutine (Deleting an Element's Thermal, Initial, and Swelling Strains)
*deck,ethdel
subroutine ethdel (ielem)
c *** primary function: delete element thermal, initial, and
c swelling strains
c input arguments:
c ielem (int,sc,in) - element number
c = 0 - delete for all defined elements
*deck,euliqr
function euliqr (ielem,key)
c *** primary function: get information about element euler angles
c input arguments:
c ielem (int,sc,in) - element number (or zero, see below)
c key (int,sc,in) - key as to the information needed
c = 1 - return info about element euler angles
c ielem > 0 - return number of euler angles on this
c element
c (record length)
c = 0 - return maximum number of euler angles
c on any element
c (max record length)
c = DB_NUMDEFINED - return the number of element euler angles
c defined in model
c output arguments:
c euliqr (int,func,out) - the returned value of euliqr is based on
c setting of key
*deck,eulget
function eulget (ielem,value)
c *** primary function: get element nodal euler angles.
c input arguments:
c ielem (int,sc,in) - element number
c output arguments:
c eulget (int,func,out) - status of element.
c = 0 - element undefined
c > 0 - number of euler angle values
c returned
c value (dp,ar(*),out) - element euler angles
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
250 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.9.45. efxiqr Function (Getting Information About Element Fluxes)
*deck,eulput
subroutine eulput (ielem,nval,value)
c *** primary function: store nodal euler angles for an element.
c input arguments:
c ielem (int,sc,in) - element number
c nval (int,sc,in) - the total number of values
c (3 * number of display nodes)
c value (dp,ar(nval),in) - the euler angle values
*deck,euldel
subroutine euldel (ielem)
c *** primary function: delete element euler angles
c input arguments:
c ielem (int,sc,in) - element number
c = 0 - delete for all defined elements
*deck,efxiqr
function efxiqr (ielem,key)
c *** primary function: get information about element fluxes
c input arguments:
c ielem (int,sc,in) - element number (or zero, see below)
c key (int,sc,in) - key as to the information needed
c = 1 - return info about element fluxes
c ielem > 0 - return number of fluxes on this
c element
c (record length)
c = 0 - return maximum number of fluxes
c on any element
c (max record length)
c = DB_NUMDEFINED - return the number of element fluxes defined
c in model
c output arguments:
c efxiqr (int,func,out) - the returned value of efxiqr is based on
c setting of key
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 251
Chapter 7: Accessing the ANSYS Database
*deck,efxget
function efxget (ielem,value)
c *** primary function: get element nodal fluxes.
c input arguments:
c ielem (int,sc,in) - element number
c output arguments:
c efxget (int,func,out) - status of element.
c = 0 - element undefined
c > 0 - number of nodal fluxes returned
c value (dp,ar(*),out) - element nodal fluxes
*deck,efxput
subroutine efxput (ielem,nval,value)
c *** primary function: store nodal fluxes at an element.
c input arguments:
c ielem (int,sc,in) - element number
c nval (int,sc,in) - the total number of values
c (ndir*nnod*nscalr)
c value (dp,ar(nval),in) - the flux values
*deck,efxdel
subroutine efxdel (ielem)
c *** primary function: delete element nodal fluxes
c input arguments:
c ielem (int,sc,in) - element number
c = 0 - delete for all defined elements
*deck,elfiqr
function elfiqr (ielem,key)
c *** primary function: get information about elem local forces
c input arguments:
c ielem (int,sc,in) - element number (or zero, see below)
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
252 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.9.52. elfdel Subroutine (Deleting Element Local Forces)
c output arguments:
c elfiqr (int,func,out) - the returned value of elfiqr is based on
c setting of key
*deck,elfget
function elfget (ielem,value)
c *** primary function: get element local nodal forces.
c input arguments:
c ielem (int,sc,in) - element number
c output arguments:
c elfget (int,func,out) - status of element.
c = 0 - element has no local nodal forces
c > 0 - number of nodal forces returned
c value (dp,ar(*),out) - element local nodal forces.
*deck,elfput
subroutine elfput (ielem,nval,value)
c *** primary function: store element local nodal forces.
c input arguments:
c variable (typ,siz,intent) description
c ielem (int,sc,in) - element number
c nval (int,sc,in) - the total number of values
c NOTE: There may be a maximum of 3 sets of
c nodal forces in the record: static
c forces, inertia forces, and damping forces
c value (dp,ar(nval),in) - element local nodal forces
*deck,elfdel
subroutine elfdel (ielem)
c *** primary function: delete element local forces
c input arguments:
c ielem (int,sc,in) - element number
c = 0 - delete for all defined elements
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 253
Chapter 7: Accessing the ANSYS Database
*deck,emniqr
function emniqr (ielem,key)
c *** primary function: get information about element misc non-summable
c data
c input arguments:
c ielem (int,sc,in) - element number (or zero, see below)
c key (int,sc,in) - key as to the information needed
c = 1 - return info about element misc non-summed data
c ielem > 0 - return number of data items on this
c element
c (record length)
c = 0 - return maximum number of data items
c on any element
c (max record length)
c = DB_NUMDEFINED - return the number of element misc non-summed
c data items defined in model
c output arguments:
c emniqr (int,func,out) - the returned value of emniqr is based on
c setting of key
*deck,emnget
function emnget (ielem,value)
c *** primary function: get misc non-summable data.
c input arguments:
c ielem (int,sc,in) - element number
c output arguments:
c emnget (int,func,out) - status of element.
c = 0 - no non-summed misc data at this
c element
c > 0 - number of data items returned
c value (dp,ar(*),out) - element misc non-summed data.
*deck,emnput
subroutine emnput (ielem,nval,value)
c *** primary function: store misc. non-summable data for an element.
c input arguments:
c ielem (int,sc,in) - element number
c nval (int,sc,in) - the total number of values
c value (dp,ar(nval),in) - the misc. non-summed data items
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
254 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.9.59. ecdput Subroutine (Storing an Element's Current Densities)
*deck,emndel
subroutine emndel (ielem)
c *** primary function: delete element misc non-summable data
c input arguments:
c ielem (int,sc,in) - element number
c = 0 - delete for all defined elements
*deck,ecdiqr
function ecdiqr (ielem,key)
c *** primary function: get information about element current densities
c input arguments:
c ielem (int,sc,in) - element number (or zero, see below)
c key (int,sc,in) - key as to the information needed
c = 1 - return info about element current densities
c ielem > 0 - return number of current densities on
c this element
c (record length)
c = 0 - return maximum number of current
c densities on any element
c (max record length)
c = DB_NUMDEFINED - return the number of element current
c densities defined in model
c output arguments:
c ecdiqr (int,func,out) - the returned value of ecdiqr is based on
c setting of key
*deck,ecdget
function ecdget (ielem,value)
c *** primary function: get calculated element current densities.
c input arguments:
c ielem (int,sc,in) - element number
c output arguments:
c ecdget (int,func,out) - status of element.
c = 0 - element has no current densities
c > 0 - number of calculated element
c current densities
c value (dp,ar(*),out) - calculated element current densities.
*deck,ecdput
subroutine ecdput (ielem,nval,value)
c *** primary function: store calculated element current densities
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 255
Chapter 7: Accessing the ANSYS Database
c input arguments:
c ielem (int,sc,in) - element number
c nval (int,sc,in) - the total number of values
c value (dp,ar(nval),in) - calculated element current densities.
*deck,ecddel
subroutine ecddel (ielem)
c *** primary function: delete element current densities
c input arguments:
c ielem (int,sc,in) - element number
c = 0 - delete for all defined elements
*deck,enliqr
function enliqr (ielem,key)
c *** primary function: get information about element nonlinear tables
c input arguments:
c ielem (int,sc,in) - element number (or zero, see below)
c key (int,sc,in) - key as to the information needed
c = 1 - return info about element nonlinear tables
c ielem > 0 - return number of nonlinear tables for
c this element
c (record length)
c = 0 - return maximum number of nonlinear
c tables for any element
c (max record length)
c = DB_NUMDEFINED - return the number of element nonlinear
c tables defined in model
c output arguments:
c enliqr (int,func,out) - the returned value of enliqr is based on
c setting of key
*deck,enlget
function enlget (ielem,value)
c *** primary function: get element nonlinear tables.
c input arguments:
c ielem (int,sc,in) - element number
c output arguments:
c enlget (int,func,out) - status of element.
c = 0 - nonlinear tables undefined
c > 0 - number of nonlinear tables defined
c value (dp ,ar(n),out) - the element nonlinear tables.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
256 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
7.9.65. ehciqr Function (Getting Information About Calculated Element Heat Generations)
*deck,enlput
subroutine enlput (ielem,n,temp)
c *** primary function: store element nonlinear tables
c input arguments:
c ielem (int,sc,in) - element number
c n (int,sc,in) - number of element nonlinear table values
c temp (dp ,ar(6),in) - element nonlinear table,etc.
*deck,enldel
subroutine enldel (ielem)
c *** primary function: delete element nonlinear tables
c input arguments:
c ielem (int,sc,in) - element number
c = 0 - delete for all defined elements
7.9.65. ehciqr Function (Getting Information About Calculated Element Heat Generations)
*deck,ehciqr
function ehciqr (ielem,key)
c *** primary function: get information about calculated elem heat generations
c input arguments:
c ielem (int,sc,in) - element number (or zero, see below)
c key (int,sc,in) - key as to the information needed
c = 1 - return info about calculated element heat gens
c for ielem > 0 - return number of heat gens for
c this element
c (record length)
c = 0 - return maximum number of heat gens
c for any element
c (max record length)
c = DB_NUMDEFINED - return the number of calculated element heat
c generations defined in model
c output arguments:
c ehciqr (int,func,out) - the returned value of ehciqr is based on
c setting of key
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 257
Chapter 7: Accessing the ANSYS Database
*deck,ehcget
function ehcget (ielem,value)
c *** primary function: get calculated element heat generations.
c input arguments:
c ielem (int,sc,in) - element number
c output arguments:
c ehcget (int,func,out) - status of element.
c = 0 - element undefined
c > 0 - number of calculated element
c heat generations
c value (dp,ar(*),out) - calculated element heat generations.
*deck,ehcput
subroutine ehcput (ielem,nval,value)
c *** primary function: store calculated element heat generations
c input arguments:
c ielem (int,sc,in) - element number
c nval (int,sc,in) - the total number of values
c value (dp,ar(nval),in) - calculated element heat generations.
*deck,ehcdel
subroutine ehcdel (ielem)
c *** primary function: delete calculated element heat generations
c input arguments:
c ielem (int,sc,in) - element number
c = 0 - delete for all defined elements
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
258 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 8: Subroutines for Users' Convenience
This chapter describes ANSYS routines available to you for use in programming. Using these routines isn't required,
but may make your life easier.These routines include a set of general routines that perform utility-type functions,
a set of routines supporting vector functions, a set of routines supporting matrix functions, and routines supporting
message processing options.
int - integer
dp - double precision
log - logical
chr - character
dcp - double precision complex
Argument size is one of the following:
sc - scalar variable
ar(n) - array variable of length n
func - functional return value
Argument intent is one of the following:
in - input argument
out - output argument
inout - both an input and an output argument
8.2.1. dptoch Subroutine (Retrieve Eight Characters From a Double Precision Variable)
*deck,dptoch
subroutine dptoch (dp8,ch8)
c *** primary function: retreive 8 characters from a dp variable
c !!! NOTICE to progammers: this routine does not convert from a !!!
c !!! machine-independent format! Use dpexttoch if this dp word !!!
c !!! came from a common or non-char database record !!!
c input arguments:
c dp8 (dp,sc,in) - dp variable containing characters
c output arguments:
c ch8 (ch*8,sc,out) - characters retreived from the dp word
*deck,wrinqr
function wrinqr (key)
c *** primary function: obtain information about output
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 259
Chapter 8: Subroutines for Users' Convenience
c input arguments:
c variable (typ,siz,intent) description wrcom name
c key (int,sc,in)
c = WR_PRINT - print flag (kprint) prtkey
c wrinqr = 0 - no output
c = 1 - print
c = WR_OUTPUT - current output unit number (iott) outfil
c = WR_MASTEROUT - master output file frstot
c = WR_COLINTER - interactive columns per page intcol
c = WR_COLBATCH - batch columns per page batcol
c = WR_LINEINTER - interactive lines per page intlin
c = WR_LINEBATCH - batch lines per page batlin
c = WR_CHARITEM - characters per output item chrper
c = WR_CHARDECIMAL - characters past decimal chrdec
c = WR_CHARINTEGER - characters in leading integer chrint
c = WR_CHARTYPE - chrtyp
c wrinqr = 1 - using E format in output
c = 2 - using F format in output
c = 3 - using G format in output
c = WR_SUPTITLE - tlabel supress key keyhed
c = WR_SUPSUBTITLE - subtitle supress key keytit
c = WR_SUPLSITER - ls,iter id supress key keyid
c = WR_NOTELINE - note line supress key keynot
c = WR_SUPCOLHEADER - column header supress key keylab
c = WR_SUPCOLMAX - column maximum supress key keysum
c = WR_LISTOPT - ListOpt from /output command ListOpt
c output arguments:
c wrinqr (int,func,out) - the value corresponding to key
*deck,erinqr
function erinqr (key)
c *** primary function: obtain information from errors common
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c input arguments:
c key (int,sc,in) - item to be returned
c 1=keyerr, 2=errfil, 3=numnot, 4=numwrn,
c 5=numerr, 6=numfat, 7=maxmsg, 8=lvlerr,
c 9=mxpcmd, 10=nercmd, 11=nertim,12=nomore,
c 13=eropen,14=ikserr, 15=kystat,16=mxr4r5,
c 17=mshkey, 19=opterr,20=flowrn,
c 21=errhpi,22=noreport,23=pdserr,24=mxpcmdw
c 25=kystop,26=icloads, 27=ifkey
c
c ---- below definitions copied from errcom 7/92 for user information
c
c *** key number= ..........................
c (see ansysdef for parameter definitions) |
c \/
c
co keyerr - master error flag (ER_ERRORFLAG)
co errfil - errors file unit number (ER_ERRORFILE)
co numnot - total number of notes displayed (ER_NUMNOTE)
co numwrn - total number of warnings displayed (ER_NUMWARNING)
co numerr - total number of errors displayed (ER_NUMERROR)
co numfat - total number of fatals displayed (ER_NUMFATAL)
co maxmsg - max allowed number of displayed messages before abort(ER_MAXMESSAGE)
co lvlerr - used basicly in solution (from cnvr command.) (ER_ERRORLEVEL)
co -1=do not set keyerr for notes/errors/warnings.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
260 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
8.2.4.TrackBegin Subroutine (Beginning Tracking for a Subroutine Call)
*deck,TrackBegin
subroutine TrackBegin (sub32)
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 261
Chapter 8: Subroutines for Users' Convenience
c input arguments:
c sub32 (char*(*),sc,in) - name of subroutine being entered and left
c (32 characters max)
*deck,TrackEnd
subroutine TrackEnd (sub32)
c input arguments:
c sub32 (char*(*),sc,in) - name of subroutine being left
c (32 characters max)
*deck,erhandler
subroutine erhandler (filein,msgid,msglvl,lngstrng,dperr,cherr)
c input arguments:
c filein (ch*40,sc,in) - Filename used for character portion of
c message ID (this is the file name of the
c file which contains the source for this
c routine)
c
c if 'ErrorMessageProbe', then error was
c generated on another processor (distributed
c ANSYS). In that case, dperr contains the
c message already made ASCII and expanded
c
c msgid (int,sc,in) - Numeric portion of the message ID
c 1 - 9999, unique for each erhandler
c call in the FILE. Recommend using
c a sequence, similar to format conventions,
c i.e., 5000, 5010, 5020
c if filein='ErrorMessageProbe', this is the
c CPU # that originally generated the error
c msglvl (int,sc,in) - level of error (same as lngerr)
c 0=no label (used for u/i pop-ups)
c -1=no label (used for u/i pop-ups) timed
c as a note message
c 1=note, 2=warning, 3=error, 4=fatal
c -3=error w/tech supp note
c -4=fatal w/tech supp note
c (see lngerr.F for text of tech supp note)
c lngstrng (ch*(*),sc,in) - error message to display. use keywords
c of %i %g %c %/ for formating (same as
c lngerr)
c dperr (dp,ar(*),in) - vector of data to display. contains both
c integer and double precision data.
c (same as lngerr)
c if filein='ErrorMessageProbe', dperr
c contains the unpacked message and lngstrng
c and cherr are ignored
c cherr (ch*(*),ar(*),in) - vector of character data to display
c max length of character data is 32
c characters
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
262 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
8.2.8. tranx3 Subroutine (Processing Geometry for 3-D Line Elements)
*deck,intrp
subroutine intrp (klog,kppx,kstpz,xval,ax,ay,yval,nmax,kyoff)
c *** primary function: **** subroutine for single interpolation ****
c (if double interpolation is needed, see intrpt)
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c typ=int,dp,log,chr,dcp siz=sc,ar(n),func intent=in,out,inout
c
c input arguments:
c variable (typ,siz,intent) description
c klog (int,sc,in) - interpolation type
c = 0 - use linear interpolation
c = 1 - use log-log interpolation
c -- note: there is no option yet for
c lin-log or log-lin
c kppx (int,sc,in) - X value end of table signal
c = 0 - a repeated x-value will signal the end
c of the table
c = 1 - a repeated x-value will not signal the
c end of the table
c (only known use = c evaluation)
c kstpz (int,sc,in) - Y value end of table signal
c = 0 - a yval of zero will not signal the end
c of the table (e.g. stress fitting)
c = 1 - a yval of zero will signal the end of
c the table (in general, material
c properties (exception: alpx))
c
c NOTE: the end of the table will be signaled thru
c either of the above conditions, or more
c commonly, that nmax values have been processed,
c or that the present x table entry is less than
c the previous one (ax(i) .lt. ax(i-1)).
c evaluations done after the end of the table are
c evaluated as if they were at the end of the
c table. similarly, evaluations done before the
c beginning of the table are done as if they were
c done at the beginning of the table.
c
c xval (dp,sc,in) - value of x with which to go into the table
c ax (dp,ar(*),in) - table of x values, in ascending order
c ay (dp,ar(*),in) - table of y values
c nmax (int,sc,in) - maximum table size allowed
c
c output arguments:
c yval (dp,sc,out) - value of y which comes back from the table
c kyoff (int,sc,out) - xval status flag
c = 0 - xval in x range
c = 1 - xval less than minimum x
c = 2 - xval greater than maximum x
c
*deck,tranx3
subroutine tranx3 (nnod,xyz,nx,tr)
c *** primary function: geometric processor for 3-d line elements
c with or without a 3rd node
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c input arguments:
c nnod (int,sc,in) - number of nodes (2 or 3)
c xyz (dp,ar(nx,*),in) - coordinates (x,y,z down)
c nx (int,sc,in) - row dimension of xyz array
c
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 263
Chapter 8: Subroutines for Users' Convenience
c output arguments:
c tr (dp,ar(3,3),in) - transformation matrix
c
*deck,systop
subroutine systop (icode)
c *** primary function: stop an ansys run
c *** secondary functions: pass an error code to the system
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c input arguments:
c icode (int,sc,in) - stop error code (0<icode<127)
c 0 - normal exit
c 1 - stack overflow error
c 2 - stack level overflow
c 3 - stack pop below zero
c 4 - names do not match in stkpxp
c 5 - command line argument error
c 6 - unused (was: accounting file error)
c 7 - licensing failure
c 8 - indicated error or end-of-run
c 11 - error in user routine
c 12 - macro stop command
c 13 - job already running
c 14 - untrapped xox error
c 15 - anserr fatal error
c 16 - possible full disk
c 17 - possible corrupted or missing file
c 18 - Error in VM routines (corrupt db?)
c 21 - unauthorized code section entered
c 25 - unable to open x11 server
c 30 - quit signal
c 31 - failure to get signal in max time
c (syhold)
c >32 - system dependent error
c 35 - fatal error on another process
c (distributed ANSYS)
c
c output arguments: none
*deck,vdot
function vdot (v1,v2,n)
c *** primary function: compute dot product of vectors v1 and v2
c input arguments:
c v1 (dp,ar(n),in) - vector v1
c v2 (dp,ar(n),in) - vector v2
c n (int,sc,in) - length of vectors v1 and v2
c output arguments:
c vdot (dp,sc,out) - dot product of v1 and v2
c
*deck,vsum
function vsum (va,n)
c *** primary function: sum the components of a vector
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
264 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
8.3.7. vzero Subroutine (Initializing a Vector to Zero)
c input arguments:
c va (dp,ar(n),in) - vector va
c n (int,sc,in) - length of vector va
c output arguments:
c vsum (dp,sc,out) - vector sum
8.3.3. vmax Function (Retrieving the Maximum Vector Value at a Given Location)
*deck,vmax
function vmax (v,n,locmax)
c *** primary function: return the max value and location in a vector
c input arguments:
c v (dp,ar(n),in) - vector v
c n (int,sc,in) - length of vector v
c output arguments:
c locmax (int,sc,out) - location of max value in vector v
c vmax (dp,sc,out) - max value in vector v
8.3.4. lastv Function (Retrieving the Position of the Last Nonzero Term in a Double Precision
Vector)
*deck,lastv
function lastv (v,n)
c ********* find position of last non-zero term in a d.p. vector *********
*deck,izero
subroutine izero (ivect,n)
c ********** set an integer vector to zero **********
c
*deck,imove
subroutine imove (i1,i2,n)
c ********** move a vector from one to another **********
c
*deck,vzero
subroutine vzero (v,n)
c *** primary function: initialize a vector to zero
c input arguments:
c v (dp,ar(n),inout) - vector to be zeroed out
c n (int,sc,in) - number of words to zero out
c output arguments:
c v (dp,ar(n),inout) - zeroed vector
c
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 265
Chapter 8: Subroutines for Users' Convenience
*deck,vmove
subroutine vmove (v1,v2,n)
c *** primary function: copy a vector into another vector
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c *** Note: This function can have unpredictable results if v1 and v2
c reference the same array and overlap.
c
c input arguments:
c v1 (dp,ar(*),in) - vector v1
c n (int,sc,in) - length of vectors v1, v2
c
c output arguments:
c v2 (dp,ar(*),out) - vector v2
c
c
*deck,vimove
subroutine vimove (v1,inc1,v2,inc2,n)
c *** primary function: move one vector into another
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c input arguments:
c v1 (dp,ar(inc1,n),in) - vector v1
c inc1 (int,sc,in) - increment on vector v1
c inc2 (int,sc,in) - increment on vector v2
c n (int,sc,in) - number of items to be moved
c
c output arguments:
c v2 (dp,ar(inc2,n),in) - vector v2
c
*deck,vinit
subroutine vinit (v,n,const)
c *** primary function: initialize a vector to a constant
c input arguments:
c n (int,sc,in) - length of vector v
c const (dp,sc,in) - constant to set vector v to
c output arguments:
c v (dp,ar(n),out) - vector v
c
*deck,viinit
subroutine viinit (v,inc,n,const)
c *** primary function: set the components of vector v to const by increments
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c input arguments:
c inc (int,sc,in) - increment (first dimension) of vector v
c n (int,sc,in) - length (second dimension) of vector v
c const (dp,sc,in) - constant to set components of vector v to
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
266 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
8.3.16. vamb1 Subroutine (Subtracting One Vector from Another)
c
c output arguments:
c v (dp,ar(inc,n),out) - vector v
c
*deck,vapb
subroutine vapb (a,b,c,n)
c *** primary function: add vector a to vector b to get vector c
c input arguments:
c a (dp,ar(n),in) - a vector
c b (dp,ar(n),in) - b vector
c n (int,sc,in) - length of vectors a,b,c
c output arguments:
c c (dp,ar(n),out) - c vector
c
*deck,vapb1
subroutine vapb1 (a,b,n)
c *** primary function: add vector b to vector a,
c and store in vector a
*deck,vapcb1
subroutine vapcb1 (a,b,n,const)
c *** primary function: multiply vector b to constant, add to vector a,
c and store in vector a
8.3.15. vamb Subroutine (Gets a Third Vector by Subtracting One Vector from Another)
*deck,vamb
subroutine vamb (a,b,c,n)
c *** primary function: subtract vector b from vector a to get vector c
c input arguments:
c a (dp,ar(n),in) - vector a
c b (dp,ar(n),in) - vector b
c n (int,sc,in) - length of vectors a,b,c
c output arguments:
c c (dp,ar(n),out) - vector c
c
*deck,vamb1
subroutine vamb1 (a,b,n)
c *** primary function: subtract vector b from vector a and save in vector a
c input arguments:
c a (dp,ar(n),inout) - a vector
c b (dp,ar(n),in) - b vector
c n (int,sc,in) - length of vectors a,b
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 267
Chapter 8: Subroutines for Users' Convenience
c output arguments:
c a (dp,ar(n),inout) - a vector
c
*deck,vmult
subroutine vmult (v1,v2,n,const)
c *** primary function: multiply a vector by a constant
c input arguments:
c v1 (dp,ar(n),in) - vector v1
c n (int,sc,in) - length of vectors v1, v2
c const (dp,sc,in) - constant to multiply v1
c output arguments:
c v2 (dp,ar(n),out) - vector v2
*deck,vmult1
subroutine vmult1 (v1,n,const)
c *** primary function: multiply a vector by a constant
c input arguments:
c v1 (dp,ar(n),inout) - vector v1
c n (int,sc,in) - length of vector n
c const (dp,sc,in) - constant to multiply v1
c output arguments:
c v1 (dp,ar(n),inout) - vector v1
c
*deck,vcross
subroutine vcross (a,b,c)
c input arguments:
c a (dp,ar(3),in) - first vector to be cross-multiplied
c b (dp,ar(3),in) - second vector to be cross-multiplied
c output arguments:
c c (dp,ar(3),out) - resulting vector
c
c
*deck,vnorme
subroutine vnorme (iel,v)
c primary function: normalize a vector to unit length
c this routine is to be called only from the elements. it is only
c for a three component vector(i.e. processing geometry).
c this routine also differs from vnorm in that an error message is called
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
268 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
8.3.23. ndpxyz Subroutine (Storing X,Y,Z for a Node)
c input arguments:
c iel (int,sc,inout) - element number
c v (dp,ar(3),inout) - vector to be normalized
c output arguments:
c iel (int,sc,inout) - if 0, vector has zero length
c v (dp,ar(3),inout) - normalized vector
*deck,vnorm
subroutine vnorm (v,n)
c *** primary function: normalize a vector to unit length
c input arguments:
c v (dp,ar(n),inout) - vector v
c n (int,sc,inout) - dimension length of vector v
c output arguments:
c v (dp,ar(n),inout) - normalized vector v
c n (int,sc,inout) - n = 0 if error in operation
*deck,ndgxyz
function ndgxyz (node,xyz)
c *** primary function: get x,y,z vector for a node.
c input arguments:
c node (int,sc,in) - node number for operation.
c output arguments:
c ndgxyz (int,sc,out) - status of node.
c 0=node is undefined.
c -1=node is unselected.
c 1=node is selected.
c xyz (dp,ar(3),out) - vector containing x,y,z
*deck,ndpxyz
subroutine ndpxyz (node,xyz)
c *** primary function: store x,y,z vector for a node.
c input arguments:
c node (int,sc,in) - node number for operation.
c xyz (dp,ar(3),in) - vector containing x,y,z
c (vector should be in global system)
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 269
Chapter 8: Subroutines for Users' Convenience
*deck,maxv
subroutine maxv (a,v,w, nr,nc)
c *** primary function: multiply a matrix by a vector
c input arguments:
c a (dp,ar(nr,*),in) - matrix a
c v (dp,ar(*),in) - vector v
c nr (int,sc,in) - number of rows in matrix a
c nc (int,sc,in) - number of columns to multiply in matrix a
c output arguments:
c w (dp,ar(*),out) - product vector w
c
*deck,maxv1
subroutine maxv1 (a,v, nr,nc)
c *** primary function: multiply a vector by a matrix
c input arguments:
c a (dp,ar(nr,nc),in) - matrix a
c v (dp,ar(nc),inout) - vector v
c nr (int,sc,in) - number of rows in matrix a
c *** nr limited to 60 ***
c nc (int,sc,in) - number of columns to multiply in matrix a
c output arguments:
c v (dp,ar(nr),inout) - product, stored in vector v
*deck,matxv
subroutine matxv (a,v,w, nr,nc)
c *** primary function: multiply vector by full transposed matrix
c input arguments:
c a (dp,ar(nr,*),in) - matrix a (first dimension must = nr)
c v (dp,ar(nv),in) - vector v (nv must be greater or equal
c to nr)
c nr (int,sc,in) - first dimension and number of active
c rows of the untransposed matrix a
c (also the number of active rows
c of vector v)
c nc (int,sc,in) - number of columns of the untransposed
c matrix a
c (also the number of computed items
c in the product vector w)
c if negative, accumulate
c output arguments:
c w (dp,ar(na,*),out) - product vector w
c
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
270 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
8.4.6. maat Subroutine (Changing a Matrix Value via Addition, Multiplication, and Transposition)
*deck,matxv1
subroutine matxv1 (a,v, nr,nc)
c *** primary function: multiply vector by full transposed matrix
c input arguments:
c a (dp,ar(nr,*),in) - matrix a
c v (dp,ar(nr),inout) - vector v
c nr (int,sc,in) - number of rows in matrix (un-transposed)
c nc (int,sc,in) - number of columns in matrix (un-transposed)
c *** nc limited to 60 ***
c output arguments:
c v (dp,ar(nc),inout) - product, stored in vector v
c
*deck,matxb
subroutine matxb (a,b,c, na,nb,nc, n1,n2,n3)
c *** primary function: (a)t * (b) = (c) t means transpose
c input arguments:
c a (dp,ar(na,*),in) - matrix a
c b (dp,ar(nb,*),in) - matrix b
c na (int,sc,in) - number of rows in matrix a
c nb (int,sc,in) - number of rows in matrix b
c nc (int,sc,in) - number of rows in matrix c
c n1 (int,sc,in) - number of rows in matrix c to fill
c n2 (int,sc,in) - number of columns in matrix c to fill
c n3 (int,sc,in) - number of columns in matrix a and
c number of rows of matrix b
c to work with (the two need
c to be the same for the inner product)
c if n3 is negative, accumulate results in c
c output arguments:
c c (dp,ar(nc,*),out) - product matrix c
c
8.4.6. maat Subroutine (Changing a Matrix Value via Addition, Multiplication, and Transpos-
ition)
*deck,maat
subroutine maat(a,c, nc,n, con)
c primary function: does con*a*at and sums the result onto c (a is a vector)
c input arguments:
c a (dp,ar(*),in) - vector to be multiplied by itself to
c generate an nxn square matrix
c (a by a-transposed)
c c (dp,ar(nc,*),inout) - matrix to be accumulated onto
c nc (int,sc,in) - number of rows in the c matrix
c n (int,sc,in) - size of square matrix
c con (dp,sc,in) - multiplier on above square matrix
c output arguments:
c c (dp,ar(nc,*),inout) - matrix to be accumulated onto
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 271
Chapter 8: Subroutines for Users' Convenience
8.4.7. matsym Subroutine (Filling the Upper Triangle from the Lower Triangle)
*deck,matsym
subroutine matsym (a,nd,n)
c primary function: fill upper triangle from lower triangle
c input arguments:
c a (dp,ar(nd,*),inout) - matrix to have its lower triangular part
c copied to its upper triangular part
c nd (int,sc,in) - number of rows of the a matrix
c n (int,sc,in) - size of matrix to be processed
c output arguments:
c a (dp,ar(nd,*),inout) - matrix that has its lower triangular part
c copied to its upper triangular part
c
*deck,mctac
subroutine mctac (a,na,c,nc,nold,nnew)
c **** function: do a = c(transpose) * a * c , where a is symmetric **
c input arguments:
c a (dp,ar(na,na),inout) matrix to be pre and post multiplied
c (part operated on must be
c square(nold x nold) and symmetric)
c na (int,sc,in) first dimension of the a matrix
c c (dp,ar(nc,nnew),in) matrix to pre and post multiply a by
c (part used may be rectangular(nold x nnew))
c nc (int,sc,in) first dimension of the c matrix
c nold (int,sc,in) size of part of 'A' matrix that is
c to be processed(input size). maximum = 64
c nnew (int,sc,in) size of part of 'A' matrix that
c results from this operation(output size).
c maximum = 64
c output arguments:
c a (dp,ar(na,na),inout) resulting matrix
c (still square(nnew x nnew) and symmetric).
*deck,tran
subroutine tran (zs,tr,nz,ntr,nrow,irot)
c primary function: perform tr-transpose * zs * tr ************
c input arguments:
c variable (typ,siz,intent) description
c zs (dp,ar(nz,nz),inout) - matrix to be transformed
c tr (dp,ar(ntr,ntr),in) - transformation matrix
c nz (int,sc,in) - dimensioned size of zs matrix
c ntr (int,sc,in) - dimensioned size of tr matrix
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
272 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
8.4.10. symeqn Subroutine (Solving Simultaneous Linear Equations)
c output arguments:
c variable (typ,siz,intent) description
c zs (dp,ar(nz,nz),inout) - transformed matrix
*deck,symeqn
function symeqn (a,nd,n,nc,defFlag)
c
c primary function: solve a set of simultaneous linear equations
c
c secondary functions: invert a matrix
c
c NOTE: this routine assumes that the matrix to be solved or
c inverted is positive or negative definite. This routine
c also assumes that the diagonals are all non-zero. If
c this assumption is not true, use isimeq.F.
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c input arguments:
c variable (typ,siz,intent) description
c a (dp,ar(nd,*),inout) - matrix to be solved or inverted
c second dimension must be at least:
c n + abs(nc)
c nd (int,sc,in) - first dimension of the a matrix
c n (int,sc,in) - number of equations
c nc (int,sc,in) - number of additional columns.
c if nc = +n or -n, invert n x n matrix and
c put result in the n+1 to 2xn columns.
c if nc is 0 or negative, nc will be reset to
c n and then symeqn will set up identity
c matrix after the input matrix, where the
c result of the inversion will be put.
c if nc is positive and less than n, do a
c partial inversion. see example 1 below.
c defFlag (int,sc,in) - flag indicating that incoming matrix MUST be:
c -1 - negative definite
c 0 - positive or negative definite
c 1 - positive definite
c
c output arguments:
c variable (typ,siz,intent) description
c symeqn (in,sc,out) - 0 - non-singular matrix
c 1 - singular matrix
c 2 - near-singular matrix
c a (dp,ar(nd,*),inout) - results or inverted matrix.
c starts in column n+1.
c note: original information is destroyed.
c
c example 1: Solve three simultaneous linear equations:
c i = symeqn (a(1,1),3,3,1)
c calling routine has a dimensioned as a(3,4)
c each equation has its 3 coefficents in the first 3 columns,
c and the constant term is in the fourth column.
c solution is in fourth column.
c
c example 2: Invert a 3x3 matrix:
c i = symeqn (a(1,1),3,3,-3)
c calling routine has a dimensioned as a(3,6)
c input matrix was input in first 3 columns
c output matrix in ouput in last 3 columns
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 273
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
274 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
Appendix A. Creating External Commands in
UNIX
External commands allow you to add your own customized extensions to ANSYS without relinking the program.
You can create custom routines in C that access any of the ANSYS API functions, link them into shared libraries
using the supplied utilities, and execute the routines via the "external command" feature within ANSYS. In addition,
ANSYS provides special commands that list all available external commands and allow you to reset all currently
referenced external commands.
External command capability is supported on all UNIX platforms. Refer to your installation guide for currently
supported compilers; the following instructions assume the presence of compatible compilers and linkers.
The most important point in the following example it that the C program interface is an integer function that
has one argument (a char pointer).
#include "cAnsInterface.h"
#include "CAnsQuery.h"
/*
-------------------------- Function Description ---------------------
extfnc
int extfnc(uecmd)
char *uecmd;
Purpose:
Demonstrate C API entry function for an external command.
Parameters:
Input
-----------------------------
uecmd
The ANSYS external command string.
Output
-----------------------------
Return Value:
The return value is ignored by the calling function;
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 275
Appendix A. Creating External Commands in UNIX
return (i);
where
-h
Produces command help.
-64
Configures the Makefile to use the -mips4 option for IRIX64 .
shared_object_name
Is the name that will be given to the shared library.
As gen_share is executing, you may see one or more "No match" messages.This is normal.The script is
searching for .c, .f, and .F file types in the current directory and returns this message if it cannot locate any
files matching one of those types.
To create a shared library called mylibrary.so, you would issue the following command:
% gen_share mylibrary.so
The utility will produce a Makefile in the current directory.You will be able to generate the shared library by is-
suing the following command:
make
For example, to create the shared library for mylibrary.so, you would issue the following command:
% make
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
276 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
A.1.3. Creating an External Table File
You will then find the specified shared library file in the current directory.You may also see warnings from the
make process, and you may need to modify the Makefile or your source code.
where
/shared/library/path/library.so
Is the path to the directory that contains the shared library file. (Remotely mounted file systems are not recom-
mended.)
~cm_name
Is the command used to invoke the function within ANSYS.The command name must begin with a tilde (~) and
each command name must be unique within the first four characters.The command name must be eight char-
acters or less, including the tilde (~).
function_name
Is the name of the function that is referenced by the specified command name. (This must be unique within the
first four characters if multiple external commands are specified.)
For example, the following entry references the /home/mydir/mylibs/myobject.so shared library and
the myobject_ function. It specifies ~myobj as the related command:
/home/mydir/mylibs/myobject.so ~myobj myobject_
ANSYS also makes use of external commands, and places its own shared libraries and the associated external
table file in the /ansys_inc/v110/ansys/lib/<platform> directory (where <platform> is the directory
specific to your computing platform, such as /sgi64 or /hppa8000-64).
If you designate a command name that has the same first four characters as a command listed in the /an-
sys_inc/v110/ansys/lib/<platform>/ans_ext.tbl file, you will not be able to access your command.
Therefore, it is a good practice to check the ANSYS external table file to make sure you have no external command
name conflicts.Do not modify the /ansys_inc/v110/ansys/lib/<platform>/ans_ext.tbl file.You
can also use the ~DEBUG command to verify that no external command name conflicts exist.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 277
Appendix A. Creating External Commands in UNIX
Note
The shared library must be consistent with the computer type and OS level on which ANSYS will be
executed.
Note
Avoid recursive external commands; that is, avoid situations where an external command calls an-
other external command.
In this example, the output lists the command, the related shared library, the function, and if the command has
been accessed.
by issuing the ~RESET command.The command issues the following message to confirm that the reset operation
was complete.
~RESET was processed: The external command buffers have been cleared.
Note
The /CLEAR command also closes/resets all external command shared libraries.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
278 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
Appendix B. Creating External Commands in
Windows
This section describes the steps required to create external commands on Windows platforms.
The C program interface is an integer function that has one argument (a char pointer).
#include <windows.h>
#include "cAnsInterface.h"
#include "CAnsQuery.h"
/*
------------------------------ Function Description -----------------------
extfnc
int extfnc(uecmd)
char *uecmd;
Purpose:
Parameters:
Input
-----------------------------
uecmd
The ANSYS external command string.
Output
-----------------------------
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 279
Appendix B. Creating External Commands in Windows
Return Value:
The return value is ignored by the calling function;
*/
int extfnc(char* uecmd)
{
/* Note: uecmd is the entire command given to invoke this function */
char* cmdsend = {"/COM, COMMAND SENT FROM EXTERNAL COMMAND"};
char* querystr = {"NODE,,NUM,MAX"};
char strrtn[32];
int i, itype;
double dblrtn;
return (i);
After launching Developer Studio, press Ctrl+N (or choose New from the FILE menu). In the New window,
click on the Projects tab. Select Win 32 Dynamic-Link Library, and specify your project name and directory.
In the Workspace frame, click on the File View tab. Right click on the sub category projname files and
press F or select Add Files to Project). Choose your source and definition files, ansys.lib, cAnsIn-
terface.h and any other necessary header files.The import library file ansys.lib is in /an-
sys110/lib and the header file cAnsysInterface.h is in /ansys110/extra/custom/include.
extfunc
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
280 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
B.1.7. Using External Commands
where:
C:\shared\library\path\projname.dll is the path to the directory that contains the shared library
file. (Remotely mounted file systems are not recommended.)
~cm_name Is the command used to invoke the function within ANSYS.The command name must begin with a
tilde (~) and the first four characters of each command name must be unique.
function_name Is the name of the function that is referenced by the specified command name. (This must
be unique within the first four characters if multiple external commands are specified.)
For example, the following entry references the C:\home\mydir\mylibs\myobject.dll shared library
and the myobject function, and specifies ~myobj as the related command:
C:\home\mydir\mylibs\myobject.dll ~myobj myobject
ANSYS also makes use of external commands, and places its own shared libraries and the associated external
table file in the C:\Program Files\Ansys Inc\V110\lib\platform directory (where platform is the
directory specific to your computing platform, such as \Intel). ANSYS loads external commands in the following
order:
If you designate a command name that has the same first four characters as a command listed in the C:\Program
Files\Ansys Inc\V110\lib\platform file, you will not be able to access your command.Therefore, it
is a good practice to check the ANSYS external table file to make sure you have no external command name
conflicts. Do not modify the C:\Program Files\Ansys Inc\V110\lib\platform\ans_ext.tbl
file.You can also use the ~DEBUG command to verify that no external command name conflicts exist.
Note
The shared library must be consistent with the computer type and OS level on which ANSYS will be
executed.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 281
Appendix B. Creating External Commands in Windows
Note
Avoid recursive external commands; that is, avoid situations where an external command calls an-
other external command.
Note that the output lists the command, the related shared library, the function, and whether or not the command
has been accessed.
by issuing the ~RESET command.This command issues the following message to confirm that the reset operation
is complete.
~RESET was processed: The external command buffers have been cleared.
Note
The /CLEAR command also closes/resets all external command shared libraries.
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
282 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
binrd8 subroutine, 59
Index binset function, 57
bintfo subroutine, 57
Symbols bintrd subroutine, 62
3-D line elements, 263 bintst program, 61
3-D nodal coordinates, 144 bintwr subroutine, 62
binwrt8 subroutine, 59
, 160 Buffered binary I/O systems
initializing, 55
A Buffered file
Abbreviations reading data from, 59
file access routines, 55 writing data to, 59
acelcm.inc file, 104
activating UPFs, 107 C
ANSYS C, 101, 103
customized version of, 105 FORTRAN shell for, 103
executing command from a user routine, 192 .c extension, 105
linking calculating
optimization program to, 185 rotation caused by internal pressure, 150
UPFs to, 105 Calculating
parameters, 104 dot product of two vectors, 264
running as a subroutine, 174 sum of vector components, 264
standard file header, 57 CDREAD
start-up using the command, 71
accessing program logic at, 183 CDWRITE
stopping, 264 using the command, 72
tailoring with UPFs, 101 CE, 74
UPFs for, 101 ceget, 211
ansyscust file, 106 ceinqr, 211
ansysdef.inc file, 104 ceput, 212
arc-length debugging, 109 cesel, 212
auto time stepping debugging, 109 Character string
/AUX2 command, 55 converting to integer string, 60
AUX2 process, 55 Characters retrieved from a double precision variable,
259
B CMBLOCK, 75
basic element pass debugging, 110 cmopt common block, 185
Beam cross sections cmopt.inc file, 104
reading, 85 cnvget subroutine, 145
Binary files /COM, 72
accessing, 53 COMBIN7 and COMBIN37 parameters, 150
characteristics of, 54 commands
closing or deleting a blocked binary file, 60 creating, 174
Converting Two Integers into a Pointer, 61 common blocks, 104
copying contents, 62 cmopt, 185
opening a blocked binary file, 57 component entities
viewing contents, 55 defining, 75
binclo subroutine, 60 constitutive material models
binhed subroutine, 58 creating, 157
binini subroutine, 55 Constraint equation
biniqr function, 56 defining constant term in, 74
binlib library, 53 Constraint equations
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 283
Index
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
284 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
Index
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 285
Index
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
286 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
Index
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 287
Index
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
288 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
Index
M N
M, 83 N, 83
maat subroutine, 271 ndcdel, 219
Master degree of freedom ndcget, 219
defining, 83 ndciqr, 219
material properties, 101 ndcput, 219
checking user-defined data, 167 ndgall, 199
customizing, 157 ndgxyz function, 269
debugging, 110 ndinqr, 198
modifying orientation of, 149 ndnext, 195
nonlinear information, 141 ndnxdf, 196
updating nonlinear strain history for, 166 ndprev, 196
Material properties ndpxyz subroutine, 269
deleting a material property table, 206 ndsel, 196
getting a material property table, 205 ndspgt, 200
getting information about a material property, 204 Neutral graphics file
storing a material property table, 206 character set used in, 90
Material property data table color specification for, 93
defining, 83 decoding , 94
matrix examples of , 94
debugging, 109 format, 90
Matrix general format of, 90
changing a matrix value, 271 plot directives , 91
filling upper triangle from lower triangle, 272 Area-Color, 92
multiplying a vector by, 270 Draw, 92
multiplying a vector by full transposed, 270 End-Plot, 93
subroutines, 270 Graph-Color , 92
transposing, 271 Line-Type, 92
transposing symmetric, 272 Line-Width, 92
matsym subroutine, 272 Marker Size, 92
matxb subroutine, 271 Move, 92
matxv subroutine, 270 No-Opt , 93
matxv1 subroutine, 271 Normal , 93
maxv subroutine, 270 parameter types for directives , 91
maxv1 subroutine, 270 Pixmap, 93
mctac subroutine, 272 Point, 92
memory management routines, 188 Polygon , 93
Meshing Start_Plot, 92
defining, 76 Text , 92
meshing debugging, 111 Text-Color, 92
miscellaneous functions, 192 Text-Size, 92
monitoring elements, 146 Window, 92
Moving one vector into another, 266 Newton-Raphson debugging, 109
MPDATA, 83 nfudel, 218
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 289
Index
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
290 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
Index
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 291
Index
debugging, 110 T
fetching, 132 table data
Scalar constants retrieving, 137
assigning to vectors, 266 tbuser subroutine, 137
scalar fields to user-defined values, 170 temperature loads
SECBLOCK, 85 defining, 144
SFBEAM, 86 Temperature table
SFE, 87 defining, 83
Simultaneous linear equations, 273 /TITLE, 72
solution control debugging, 109 tmpget subroutine, 144
solutions TrackBegin subroutine, 109, 261
accessing program logic, 183 TrackEnd subroutine, 109, 262
debugging, 109 tran subroutine, 272
soptcm.inc file, 104 transient debugging, 109
source files, 105 Transposing a matrix, 271
stack storage definition, 104 tranx3 subroutine, 263
stack.inc file, 104 trrot subroutine, 143
Standard ANSYS file header, 5758
START.ANS file, 174 U
stepcm.inc file, 104
UAnBeg subroutine, 183
Stopping ANSYS, 264
UAnFin subroutine, 183
storing
uec100 routine, 127
user-supplied element output, 148
uec100 subroutine, 127
subrd subroutine, 134
uel100 subroutine, 127128
Subroutines
uel101 subroutine, 103
accessing results files, 64
UElMatx subroutine, 151
matrix, 270
uep100 subroutine, 127, 129
tracking calls to, 261
uex100 subroutine, 127128
subroutines
UItBeg subroutine, 183
for elements, 103
UItFin subroutine, 183
for memory management, 188
ULdBeg subroutine, 183
for processing parameters, 190
ULdFin subroutine, 183
running ANSYS as, 174
/UNDO command, 192
supporting for user-created elements, 131
UNIX systems
supporting user-defined commands, 181
compiling and linking UPFs on, 105
subwrt subroutine, 135
FORTRAN programming on, 103
Surface load
UPFs (see user programmable functions (UPFs))
defining, 87
usanly subroutine, 149
defining as beams, 86
user programmable features (UPFs), 101
svgidx subroutine, 131
activating, 107
svpidx subroutine, 133
and loads, 101
svrget subroutine, 132
and material properties, 101
svrput subroutine, 132
before you begin using, 102
swell1 subroutine, 140
capabilities of, 101
swell3 subroutine, 140
compiling and linking
swelling laws, 164
on UNIX systems, 105
symeqn subroutine, 273
on Windows systems, 106
sysiqr function, 55
considerations for using, 102
system dependencies, 103
debugging, 109
systop subroutine, 264
definition of, 101
development strategy, 103
include files, 104
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
292 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.
Index
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates. 293
Index
W
wavefront reordering debugging, 111
Weld
defining, 81
Windows systems
compiling and linking UPFs on, 106
wrinqr function, 259
Writing an ANSYS substructure file, 63
wrtsub subroutine, 63
X
xyzup3 subroutine, 144
Z
Z-buffered graphics, 89
Programmer's Manual for ANSYS . ANSYS Release 11.0 . 002328 . SAS IP, Inc. All rights reserved.
294 Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.