ANSYS Probhhhhgrammers Manual
ANSYS Probhhhhgrammers Manual
ANSYS Probhhhhgrammers Manual
ANSYS APDL Programmer's Guide 1 What is APDL? 2 Adding Commands to the Toolbar 3 Using Parameters 4 APDL as a Macro Language 5 Interfacing With the GUI 6 Encrypting Macros Guide to Interfacing with ANSYS 1 Format of Binary Data Files 2 Accessing Binary Data Files 3 Using CDREAD and CDWRITE 4 ANSYS Graphics File Format ANSYS UIDL Programmer's Guide 1 What is UIDL? 2 Modifying Menu Blocks 3 Modifying Function Blocks 4 Creating Help Blocks 5 Advanced Topics
6 Programming Example Appendix A UIDL Command Dictionary Appendix B ANSYS Keywords Appendix C ANSYS Product Codes Appendix D Testing and Troubleshooting Appendix E Additional Help Tools Guide to ANSYS User Programmable Features 1 Using User Programmable Features (UPFs) 2 Accessing the ANSYS Database 3 Subroutines for Users' Convenience Appendix A External Commands
3 Using Parameters
3.1 Parameters 3.2 Guidelines for Parameter Names 3.3 Defining Parameters 3.3.1 Assigning Parameter Values During Execution 3.3.2 Assigning Parameter Values At Startup 3.3.3 Assigning ANSYS-Supplied Values to Parameters 3.3.3.1 Using the *GET Command 3.3.3.2 Using Inline Get Functions
3.3.4 Listing Parameters 3.4 Deleting Parameters 3.5 Using Character Parameters 3.6 Substitution of Numeric Parametric Values 3.6.1 Preventing Substitution 3.6.2 Substitution of Character Parametric Values 3.6.2.1 Forced Substitution 3.6.2.2 Other Places Where Character Parameters Are Valid 3.6.2.3 Character Parameter Restrictions 3.7 Dynamic Substitution of Numeric or Character Parameters 3.8 Parametric Expressions 3.9 Parametric Functions 3.10 Saving, Resuming, and Writing Parameters 3.11 Array Parameters 3.11.1 Array Parameter Basics 3.11.2 Array Parameter Examples 3.11.2 TABLE Type Array Parameters 3.11.3 Defining and Listing Array Parameters 3.11.4 Specifying Array Element Values 3.11.4.1 Specifying Individual Array Values
3.11.4.2 Filling Array Vectors 3.11.4.3 Interactively Editing Arrays 3.11.4.4 Filling an Array From a Data File Using *VREAD 3.11.4.4 Filling a TABLE Array From a Data File Using *TREAD 3.11.2 Interpolating Values 3.11.4.5 Retrieving Values into or Restoring Array Parameter Values 3.11.4.6 Listing Array Parameters 3.11.5 Writing Data Files 3.11.5.1 Format Data Descriptors 3.11.6 Operations Among Array Parameters 3.11.6.1 Vector Operations 3.11.6.2 Matrix Operations 3.11.6.3 Specification Commands for Vector and Matrix Operations 3.11.7 Plotting Array Parameter Vectors
4.2.3 Creating a Macro Within ANSYS 4.2.3.1 Using *CREATE 4.2.3.2 Using *CFWRITE 4.2.3.3 Using Utility Menu>Macro>Create Macro 4.2.4 Creating Macros with a Text Editor 4.2.5 Using Macro Library Files 4.3 Executing Macros and Macro Libraries 4.4 Local Variables 4.4.1 Passing Arguments to a Macro 4.4.2 Local Variables Within Macros 4.4.3 Local Variables Outside of Macros 4.5 Controlling Program Flow in APDL 4.5.1 Nested Macros: Calling Subroutines Within a Macro 4.5.2 Unconditional Branching: Goto 4.5.3 Conditional Branching: The *IF Command 4.5.4 Repeating a Command 4.5.5 Looping: Do-Loops 4.6 Control Functions Quick Reference 4.7 Using the _STATUS and _RETURN Parameters in Macros 4.8 Using Macros with Components and Assemblies
6 Encrypting Macros
6.1 Preparing a Macro for Encryption 6.2 Creating an Encrypted Macro 6.3 Running an Encrypted Macro
COMMAND
path/filename.ext
ARGUMENT
Argument
command,arg1,arg2
Note-
Information that supplements the main topic being discussed, such as important tips or guidelines. Actions or situations that could cause problems, unexpected ANSYS behavior, or unexpected results. Actions or situations that can shut down ANSYS, damage files, cause loss of data, etc.
Caution:
Warning:
that you can use to directly access the ANSYS database. You can also use these capabilities to access data in any of the binary files that ANSYS writes or uses. The entire set of programmer's guides can be accessed online as HTML files or downloaded (in either HTML or Postscript format) through the ANSYS documentation web site, http://www.ansys.com/Documentation/Manuals/872. You can also order a hardcopy version of the set by downloading the Documentation order form from http://www.ansys.com/ServSupp/Library/library.html
APDL stands for ANSYS Parametric Design Language, a scripting language that you can use to automate common tasks or even build your model in terms of parameters (variables). APDL also encompasses a wide range of other features such as repeating a command, macros, if-then-else branching, do-loops, and scalar, vector and matrix operations. While APDL is the foundation for sophisticated features such as design optimization and adaptive meshing, it also offers many conveniences that you can use in your day-to-day analyses. In this guide we'll introduce you to the basic features- parameters; macros; branching, looping, and repeating; and array parameters-and show you some simple examples. As you become more adept at the language, you will see that the applications for APDL are limited only by your imagination.
You can add frequently used ANSYS functions or macros to the ANSYS toolbar (creating macros is covered starting in Section 4.1). You do this by defining abbreviations. An abbreviation is simply an alias (up to eight characters long) for an ANSYS command, GUI function name, or macro name. For example, MATPROP might be an abbreviation for a macro that lists material properties, SAVE_DB is an abbreviation for the SAVE command, and QUIT is an abbreviation for the Fnc_/EXIT function (which launches the "Exit from ANSYS" dialog box). The ANSYS program provides two ways to use abbreviations. You can issue the abbreviation (and execute the macro, command, etc. that it performs) by typing it at the beginning of a command line. Or, if you're using the ANSYS GUI, you can execute the macro or command by pressing the appropriate button on the ANSYS toolbar. The toolbar, shown in the following figure, contains buttons that correspond to existing abbreviations. Figure 2-1 The ANSYS Toolbar Showing the Default Buttons.
While some abbreviations, such as SAVE_DB, are predefined, the abbreviations the toolbar contains and the functions they execute are up to you. A single toolbar can hold up to 100 abbreviations (you can "nest" toolbars to extend this number). You can redefine or delete abbreviations at will; however, abbreviations are not automatically saved and must be explictly saved to a file and reloaded for each ANSYS session.
You can create abbreviations either through the *ABBR command or through the Utility Menu > Macro > Edit Abbreviations or Utility Menu >MenuCtrls > Edit Toolbar menu items. Using one of the menu items is preferable for two reasons:
G
Clicking OK automatically updates the toolbar (using the *ABBR command requires that you use the Utility Menu >MenuCtrls > Update Toolbar menu item to make your new abbreviation appear on the toolbar). You can easily edit the abbreviation if required.
The syntax for the *ABBR command and related dialogs is *ABBR, Abbr, String Where Abbr The abbreviation name that will appear on the toolbar button. The name can contain up to eight characters. String The Stringargument is the name of the macro or command that Abbrrepresents. If Stringis the name of a macro, the macro must be within the macro search path. For more information about using macros, see Section 4.1. If Stringreferences an ANSYS picking menu or dialog box (using UIDL), then specify "Fnc_string." For example, in the abbreviation definitions for "QUIT," "POWRGRPH," and "ANSYSWEB" shown above, "Fnc_/QUIT," "Fnc_/GRAPHICS," and "Fnc_HomePage" are all unique UIDL function names which identify the ANSYS picking menu or dialog box associated with the QUIT, POWRGRPH, and ANSYSWEB abbreviations respectively. For more information about accessing UIDL functions, see Section 5.6. The stringyou specify can contain up to 60 characters and it can't include any of the following:
G G
The character "$" The commands C***, /COM, /GOPR, /NOPR, /QUIT, /UI, or *END
The default ANSYS toolbar has the following abbreviations predefined: *ABBR, *ABBR, *ABBR, *ABBR, *ABBR, SAVE_DB, SAVE RESUM_DB, RESUME QUIT, Fnc_/EXIT POWRGRPH, Fnc_/GRAPHICS ANSYSWEB, Fnc_HomePage
For example, to add a button to the toolbar that calls the macro file mymacro.mac, you would enter the values shown in the following figure in the Utility Menu >MenuCtrls > Edit Toolbar dialog box. Figure 2-2 Adding a New Abbreviation.
The new button is appended to the button bar as shown in the following figure. Figure 2-3 The Button for the New Abbreviation.
Toolbar buttons are not persistent from one ANSYS session to the next; however, they are saved and maintained in the database so that any "resume" of the session will still contain these abbreviations. To save your custom button definitions, you must explicitly save them to a file through the Utility Menu >MenuCtrls > Save Toolbar menu item (*ABBSAV command) and restore them for each session using the Utility Menu >MenuCtrls > Restore Toolbar menu item (*ABBRES command). You can do this programmatically in a macro. Note-If any abbreviations already exist in the named file, the *ABBSAV command overwrites them. The format of the abbreviations file is simply the APDL commands that are used to create the abbreviations. Thus, if you wish to edit a large set of buttons or change their order, you may find using a text editor to be the most convenient method. For example, the following is the file that results from saving the default toolbar buttons. /NOPR
The *ABB commands (the abbreviated form of *ABBR) define the buttons. The /NOPR at the top turns off echoing to the log file while the /GO at the bottom turns log file echoing on.
3.1 Parameters
Parameters are APDL variables (they are more similar to Fortran variables than to Fortran parameters). You don't need to explicitly declare the parameter type. All numeric values (whether integer or real) are stored as double-precision values. Parameters that are used but not defined are assigned a near-zero, or "tiny," value of approximately 2-100. For example, if parameter A is defined as A=B, and B is not defined, then A is assigned the tiny value. ANSYS uses two types of parameters: scalar and array. The first part of this chapter discusses information that is applicable to both types. Starting with section 3.11, the information is specific to array type parameters. Character strings (up to eight characters long) can be assigned to parameters by simply enclosing the string in single quotes. APDL also provides several types of array parameters: numeric, character, and table (a special numeric type that automatically interpolates values). You can use a parameter (instead of a literal number or character string) as an argument to any ANSYS command; the parameter is evaluated and its current value is used for that argument. For example, if you assign the value 2.7 to a parameter named AA and then issue the command N,12,AA,4 the ANSYS program will interpret the command as N,12,2.7,4 (which defines node 12 at X=2.7 and Y=4).
Begin with a letter. Contain only letters, numbers, and underscore characters. Contain no more than eight characters.
PI X_OR_Y Invalid: NEW_VALUE (more than 8 characters) 2CF3 (begins with a number) M&E (invalid character "&") When naming parameters
G
Avoid parameter names that match commonly used ANSYS labels, such as: H Degree of freedom (DOF) labels (TEMP, UX, PRES, etc.) H Convenience labels (ALL, PICK, STAT, etc.) H User-defined labels (such as those defined with the ETABLE command) H Array type field labels (such as CHAR, ARRAY, TABLE, etc.) Be aware that parameter names ARG1 through ARG9 and AR10 through AR99 are reserved for local parameters. Generally, local parameters are used in macros (see Section 4.4). Use of these names as "regular" parameters is not recommended. Make sure that parameter names don't match abbreviations defined with the *ABBR command. For more information about abbreviations, see Section 2.1. Don't begin parameter names with an underscore (_). This is the convention reserved for parameters used by the GUI and ANSYS-supplied macros.
*SET,ABC,-24 *SET,QR,2.07E11 *SET,XORY,ABC *SET,CPARM,'CASE1' You can use an "=" as a shorthand way of calling the *SET command (this is the most convenient method). The format of the shortcut is Name=Value, where Name is the name assigned to the parameter and Value is the numeric or character value stored in that parameter. For character parameters, the assigned value must be enclosed in single quotes and cannot exceed eight alphanumeric characters. The following are examples of "=" in use: ABC=-24 QR=2.07E11 XORY=ABC CPARM='CASE1' In the GUI, you can either type the "=" directly in the ANSYS input window or in the "Selection" field of the Scalar Parameter dialog box (accessed by the Utility Menu>Parameters>Scalar Parameters menu item).
The *GET command, which retrieves a value from a specified item and stores it in a specified parameter. The inline get functions, which can be used in operations. Each get function returns a specific value from a specific item.
node, an element, an area, etc.) and stores it as a user-named parameter. Various keyword, label, and number combinations identify the retrieved item. For example, *GET,A,ELEM,5,CENT,X returns the centroid x-location of element 5 and stores the result as parameter A. The format for the *GET command is: *GET,Par,Entity,ENTNUM,Item1,IT1NUM,Item2,IT2NUM where
G G
G G
Par is the name of the parameter to store the retrieved item. Entity is a keyword for the item to be stored. Valid keywords are NODE, ELEM, KP, LINE, AREA, VOLU, etc. For a complete list of valid keywords, see the *GET description in the ANSYS Commands Reference. ENTNUM is the number of the entity (or zero for all entities). Item1 is the name of an item for a particular entity. For example, if Entity is ELEM, Item1 will be either NUM (the highest or lowest element number in the selected set) or COUNT (the number of elements in the set). (For a complete list of Item1 values for each entity type, see the *GET description in the ANSYS Commands Reference.)
You can think of the *GET command as a path down a tree structure, from general to specific information. The following examples show the *GET command in use. The first command below gets the material attribute (the MAT reference number) of element 97 and assigns it to parameter BCD: *GET,BCD,ELEM,97,ATTR,MAT *GET,V37,ELEM,37,VOLU *GET,EL52,ELEM,52,HGEN *GET,OPER,ELEM,102,HCOE,2 *GET,TMP,ELEM,16,TBULK,3 *GET,NMAX,NODE,,NUM,MAX *GET,HNOD,NODE,12,HGEN *GET,COORD,ACTIVE,,CSYS ! ! ! ! ! ! ! ! BCD = Material number of element 97 V37 = volume of element 37 EL52 = value of heat generation in element 52 OPER = heat coefficient of element 102,face2 TMP = bulk temperature of element 16,face3 NMAX = maximum active node number HNOD = value of heat generation at node 12 COORD = active coordinate system number
NELEM(ENUM,NPOS) returns the node number in position NPOS for element ENUM. Combining functions, NX(NELEM(ENUM,NPOS)) returns the x-location of that node. The following table summarizes the available get functions: Get Function Retrieved Value Entity Status: NSEL(N) Status of node N (-1=unselected, 0=undefined, 1=selected) ESEL(E) Status of element E (-1=unselected, 0=undefined, 1=selected) KSEL(K) Status of keypoint K (-1=unselected, 0=undefined, 1=selected) LSEL(L) Status of line L (-1=unselected, 0=undefined, 1=selected) ASEL(A) Status of area A (-1=unselected, 0=undefined, 1=selected) VSEL(V) Status of volume V (-1=unselected, 0=undefined, 1=selected) Next Selected Entity: NDNEXT(N) Next selected node having a node number greater than N ELNEXT(E) Next selected element having an element number greater than E KPNEXT(K) Next selected keypoint having a keypoint number greater than K LSNEXT(L) Next selected line having a line number greater than L ARNEXT(A) Next selected area having an area number greater than A VLNEXT(V) Next selected volume having a volume number greater than V Locations: CENTRX(E) CENTRY(E) CENTRZ(E) NX(N) Centroid x-coordinate of element E in global Cartesian coordinate system Centroid y-coordinate of element E in global Cartesian coordinate system Centroid z-coordinate of element E in global Cartesian coordinate system X-coordinate of node N in the active coordinate system
Y-coordinate of node N in the active coordinate system Z-coordinate of node N in the active coordinate system X-coordinate of keypoint K in the active coordinate system Y-coordinate of keypoint K in the active coordinate system Z-coordinate of keypoint K in the active coordinate system
LX(L,LFRAC) X-coordinate of line L at length fraction LFRAC (0.0 to 1.0) LY(L,LFRAC) Y-coordinate of line L at length fraction LFRAC (0.0 to 1.0) LZ(L,LFRAC) Z-coordinate of line L at length fraction LFRAC (0.0 to 1.0) Nearest to Location: Number of the selected node nearest the X,Y,Z point (in the active coordinate system; lowest number for coincident nodes) Number of the selected keypoint nearest the X,Y,Z point (in the active coordinate system; lowest number for coincident keypoints)
NODE(X,Y,Z)
KP(X,Y,Z)
Distance: DISTND(N1,N2) Distance between nodes N1 and N2 DISTKP(K1,K2) Distance between keypoints K1 and K2 Distance between the centroid of element E and node N. Centroid is determined from the selected nodes on the element.
DISTEN(E,N)
Angles: Subtended angle between two lines (defined by three nodes where N1 is the vertex node). Default is in radians (see the *AFUN command to select degrees). Subtended angle between two lines (defined by three keypoints where K1 is the vertex keypoint). Default is in radians (see the *AFUN command to select degrees).
ANGLEN(N1,N2,N3)
ANGLEK(K1,K2,K3)
Nearest to Entity:
NNEAR(N) KNEAR(K)
ENEARN(N) Selected element nearest node N. The element position is calculated from the selected nodes. Areas: AREAND(N1,N2,N3) Area of the triangle with vertices at nodes N1, N2, and N3 AREAKP(K1,K2,K3) Area of the triangle with vertices at keypoints K1, K2, and K3 Area at node N apportioned from selected elements attached to node N. For 2-D planar solids, returns edge area associated with the node. For axisymmetric solids, returns edge surface area associated with the node. For 3-D volumetric solids, returns face area associated with the node.
ARNODE(N)
Normals: NORMNX(N1,N2,N3) X-direction cosine of the normal to the plane containing nodes N1, N2, and N3 NORMNY(N1,N2,N3) Y-direction cosine of the normal to the plane containing nodes N1, N2, and N3 NORMNZ(N1,N2,N3) Z-direction cosine of the normal to the plane containing nodes N1, N2, and N3 NORMKX(K1,K2,K3) X-direction cosine of the normal to the plane containing keypoints K1, K2, and K3 NORMKY(K1,K2,K3) Y-direction cosine of the normal to the plane containing keypoints K1, K2, and K3 NORMKZ(K1,K2,K3) Z-direction cosine of the normal to the plane containing keypoints K1, K2, and K3 Connectivity: Element connected to node N. LOC is the position in the resulting list when many elements share the node. A zero is returned at the end of the list.
ENEXTN(N,LOC)
NELEM(E,NPOS) Node number in position NPOS (1-20) of element E Faces: Element adjacent to a face (FACE) of element E. The face number is the same as the surface load key number. Only elements of the same dimensionality and shape are considered. A -1 is returned if more than one element is adjacent; A 0 is returned if there are no adjacent elements.
ELADJ(E,FACE)
Node in position LOC of a face number FACE of element E. The face number is the same as NDFACE(E,FACE,LOC) the surface load key number. LOC is the nodal position on the face (for an IJLK face, LOC=1 is at node I, 2 is at node J, etc.). Face number of element E containing the selected nodes. The face number output is the surface load key. If multiple load keys occur on a face (such as for line and area elements), the lowest load key for that face is output. For 2-D planar solids and 3-D volumetric solids, returns the area of the face of element E containing the selected nodes. For axisymmetric elements, the area is the full (360) area.
NMFACE(E)
ARFACE(E)
Degree of Freedom Results: UX(N) UY(N) UZ(N) UX structural displacement at node N UY structural displacement at node N UZ structural displacement at node N
ROTX(N) ROTX structural rotation at node N ROTY(N) ROTY structural rotation at node N ROTZ(N) ROTZ structural rotation at node N TEMP(N) Temperature at node N PRES(N) Pressure at node N VX(N) VY(N) VZ(N) VX fluid velocity at node N VY fluid velocity at node N VZ fluid velocity at node N
ENKE(N) Turbulent kinetic energy (FLOTRAN) at node N ENDS(N) Turbulent energy dissipation (FLOTRAN) at node N VOLT(N) Electric potential at node N MAG(N) Magnetic scalar potential at node N AX(N) AX magnetic vector potential at node N
AY(N) AZ(N)
You can also access this information through either the Utility Menu>List>Other>Parameters or Utility Menu>List>Status>Parameters>All Parameters menu items. Note-Any parameters beginning or ending in an underscore (_) are not shown by the *STATUS command. You can check the status of individual parameters by providing these as arguments to the *STATUS command. The following example shows the status of the ABC parameter. *STATUS,ABC PARAMETER STATUS- abc NAME ABC VALUE -24.0000000 ( TYPE SCALAR 5 PARAMETERS DEFINED) DIMENSIONS
You can also check the status of specific parameters through the Utility Menu>List>Other>Named Parameter or Utility Menu>List>Status> Parameters>Named Parameters menu items. Note-Although ANSYS allows a maximum of 1000 parameters, fewer than 1000 are available to the user due to GUI and ANSYS macro requirements. The number of parameters defined by the user interface (internal parameters) is listed by the *STATUS command. The command *GET,par,PARM,,MAX returns the total number of parameters defined.
Issue the "=" command, leaving the right-hand side of the command blank. For example, to delete the QR parameter issue this command:
QR=
G
Issue the *SET command (Utility Menu>Parameters>Scalar Parameters), but don't specify a value for the parameter. For example, to delete the QR parameter via the *SET command issue the command as follows:
*SET,QR, Setting a numeric parameter equal to zero doesn't delete it. Similarly, setting a character parameter equal to empty single quotes (` `) or placing blanks within single quotes doesn't delete the parameter.
As arguments to any applicable command field (that is, where alphanumeric input is expected) As macro name arguments for the *USE command (Utility Menu>Macro>Execute Data Block) ! MACRO is the name of a macro file ! Calls MACRO
NAME='MACRO' *USE,NAME
G
As arguments to macro calls for *USE and for the "unknown command" macro. Any of the following macro calls are allowed:
Note-Defining the parameter after it is used in a command does not "update" the command in most cases. (Exceptions are the commands /TITLE, /STITLE, *ABBR, and /TLABEL. See Section 3.6.2.1 for more information.) For example: Y=0 X=2.7 N,1,X,Y Y=3.5
G G
/TITLE command (Title field). Specifies titles for various printed output. /STITLE command (Title field). Specifies subtitles, similar to /TITLE. (You cannot access the /STITLE command directly in the GUI.) /TLABEL command (Text field). Specifies text string for annotation. /SYP command (ARG1 - ARG8 fields). Passes a command string (plus arguments) to the operating system. (You cannot access the /SYP command directly in the GUI.) *ABBR command (Abbr field). Defines an abbreviation.
Any filename or extension command argument. These arguments apply to commands such as /FILENAME, RESUME, /INPUT, /OUTPUT, and FILE. (Direct parameter substitution is also valid in these fields.) Any 32 character field: A typical example is the directory path field that is available for many commands. (Direct substitution is not valid for these fields.) As a command name in any command name field. Also as an "unknown command" macro name in field 1. For example:
R='RESUME' %R%,MODEL,DB
The following example of the command input method shows forced substitution for a subtitle definition and for a directory name. A='TEST' B='.RST' C='/ANSYS' D='/MODELS/' /STITLE,,RESULTS FROM FILE %C%%D%%A%%B%
/POST1 FILE,A,RST,%C%%D%
These commands will save character parameters to a file (PARSAV command or menu path Utility Menu>Parameters> Save Parameters) and resume character parameters from a file (PARRES or Utility Menu>Parameters> Restore Parameters). *VREAD This command (Utility Menu>Parameters>Array Parameters>Read from File)can be used to read alphanumeric character data from a file and produce a character array parameter. The FORTRAN character descriptor (A) may be used in the format line which must follow the *VREADcommand. *VWRITE This command (menu path Utility Menu>Parameters>Array Parameters>Write to File) can be used to write character parameter data to a file in a formatted sequence. The FORTRAN character descriptor (A) may be used in the format line which must follow the *VWRITEcommand.
G G
Character parameter substitution is not allowed for the Par argument of the *SET, *GET, *DIM, and *STATUS commands. Interactive editing of array parameters (*VEDIT command) is not available for character array parameters. Vector operation commands, such as *VOPER, *VSCFUN, *VFUN, *VFILL, *VGET, and *VITRP, do not work with character array parameters. When operating on character parameters, the specification commands *VMASK and *VLEN are applicable only to the *VWRITE and *VREAD commands. Character parameters are not valid in parametric expressions which use addition, subtraction, multiplication, etc.
INC=A1+(31.4/9) M=((X2-X1)**2-(Y2-Y1)**2)/2 The following is a complete list of APDL operators: Operator Operation + _ * / ** < > Addition Subtraction Multiplication Division Exponentiation Less-Than Comparison Greater-Than Comparison
You can also use parentheses for clarity and for "nesting" of operations, as shown above. The order in which the ANSYS program evaluates an expression is as follows: 1. Operations in parentheses (innermost first) 2. Exponentiation (in order, from right to left) 3. Multiplication and division (in order, from left to right) 4. Unary association (such as +A or -A) 5. Addition and subtraction (in order, from left to right) 6. Logical evaluation (in order, from left to right) Thus an expression such as Y2=A+B**C/D*E will be evaluated in this order: B**C first, /D second, *E third, and +A last. For clarity, you should use parentheses in expressions such as these. Parentheses can be nested up to four levels deep, and up to nine operations can be performed within each set of parentheses. As a general rule, avoid using blank spaces between
operators in expressions. In particular, never include a blank space before the * character because the rest of the input line (beginning with the *) will be interpreted as a comment and therefore will be ignored. (Don't use this convention as a comment; use an exclamation point (!) for this purpose.)
RAND(x,y)
GDIS(x,y)
SINH(x), COSH(x), TANH(x) Hyperbolic sine, Hyperbolic cosine, and Hyperbolic tangent of x. Arcsine, Arccosine, and Arctangent of x. x must be between -1.0 and +1.0 for ASIN and ASIN(x), ACOS(x), ATAN(x) ACOS. Output is in radians by default, but can be changed to degrees with *AFUN. Range of output is -pi/2 to +pi/2 for ASIN and ATAN, and 0 to pi for ACOS. Arctangent of y/x with the sign of each component considered. Output is in radians by default, but can be changed to degrees with *AFUN. Range of output is -pi to +pi. Numerical value of CPARM (if CPARM is anumeric, returns 0.0).
ATAN2(y,x)
VALCHR (CPARM)
CHRVAL (PARM)
Character value of numerical parameter PARM. Number of decimal places depends on magnitude. Upper case equivalent of CPARM. Lower case equivalent of CPARM.
The following are examples of parametric functions: PI=ACOS(-1) Z3=COS(2*THETA)-Z1**2 R2=SQRT(ABS(R1-3)) X=RAND(-24,R2) *AFUN,DEG THETA=ATAN(SQRT(3)) PHI=ATAN2(-SQRT(3),-1) *AFUN,RAD ! PI = arc cosine of -1, PI calculated to machine accuracy
! X = random number between -24 and R2 ! ! ! ! Units for angular functions are degrees THETA evaluates to 60 degrees PHI evaluates to -120 degrees Units for angular functions reset to radians
X249=NX(249) ! X-coordinate of node 249 SLOPE=(KY(2)-KY(1))/(KX(2)-KX(1)) ! Slope of line joining keypoints 1 and 2 CHNUM=CHRVAL(X) UPPER=UPCASE(LABEL) ! CHNUM = character value of X ! UPPER = uppercase character value of parameter LABEL
To read parameters from a file use the PARRES command (Utility Menu>Parameters>Restore Parameters) If you wish, you can write up to ten parameters or array parameters using FORTRAN real formats to a file. You can use this feature to write your own output file for use in other programs, reports, etc. To do this, use the *VWRITE command (Utility Menu>Parameters>Array Parameters>Write to File). The *VWRITE command command is discussed in
Section 3.11.7.
One-dimensional (a single column) Two-dimensional (rows and columns) Three-dimensional (rows, columns, and planes)
ANSYS provides three types of arrays ARRAY This type is similar to FORTRAN 77 arrays and is the default array type when dimensioning arrays. As with FORTRAN arrays, the indices for rows, columns, and planes are sequential integer numbers beginning with one. Array elements can be either integers or real numbers. This type can have up to 10242-1 rows, up to 255 columns, and up to 7 planes. CHAR This is a character array, with each element consisting of an alphanumeric value not exceeding eight characters. The indices for rows, columns, and planes are sequential integer numbers beginning with one. This type can have up to 10242-1 rows, up to 255 columns, and up to 7 planes. TABLE This is a special type of numeric array which allows ANSYS to calculate (through linear interpolation) values between these array elements explicitly defined in the array. Moreover, you can define the array indices for each row, column, and plane and these indices are real (not integer) numbers. Array elements can be either integers or real numbers. As we'll see in the later discussion on TABLE arrays, this capability provides a powerful method for describing mathematical functions. This type can have up to 65,535 rows, up to 255 columns, and up to 7 planes.
We can extend these definitions to a three-dimensional array parameter, which may be m rows long, n columns wide, and p planes deep. The plane index number is k, which varies from 1 to p. Each array element is identified as (i,j,k). The following figure shows a three-dimensional array. Figure 3-2 A Graphical Representation of a Three-Dimensional Array.
The parameter NTEMP could be an array of temperatures at selected nodes; NTEMP(1)=-47.6 could be the temperature at node 27, NTEMP(2)=-5.2 could be the temperature at node 43, and so on. Similarly, EVOLUM could be an array of element volumes, and COMPSTRS could be an array of nodal component stresses, with each column representing a particular direction (X, Y, Z, XY, YZ, XZ, for example). A type CHAR array parameter is structured similarly to an ARRAY parameter, with the tabular values being alphanumeric character strings (up to eight characters). Two examples of character array parameters are:
A type TABLE array parameter consists of numbers (alphanumeric values are not valid) arranged in a tabular fashion, much like the ARRAY type. However, there are three important differences
G
ANSYS can calculate (through linear interpolation) any values that fall in-between the explicitly declared array element values. A table array contains a 0 row and 0 column used for data-access index values, and unlike standard arrays, these index values can be real numbers. The only restriction is that the index values must be numerically increasing (never decreasing) numbers. You must explicitly declare a data access index value for each row and column; otherwise the default value assigned is the "tiny number" (7.888609052E-31). A plane index value resides in the 0,0 location for each plane.
The following figure shows a TABLE array with data-access index values. Note that the indexes are specified as the "0" row and column values.
As shown in the above example, when configuring a table array you must set
G G
The plane index value as the 0,0 element value for each plane. The data-access column index values in the elements in the 0 row in plane 1. These values are used only when accessing data from the array. When setting the array element values, you use the traditional row and column index numbers. The data-access row index values in the elements in the 0 column in plane 1. Again, these values are used only when accessing data from the array. When setting the array element values, you use the traditional row and column index numbers.
Row and column index values may be set or changed in any plane, and those values will be applied to all planes.
Note-Array elements for ARRAY and TABLE are initialized to 0 (except for the 0 row and column for TABLE, which is initialized to the tiny value). Array elements for CHAR are initialized to a blank value.
G G
Setting individual array element values through the *SET command or "=" shortcut. Filling individual vectors (columns) in the array with either specified or calculated values (the *VFILL command, for example). Interactively specifying values for the elements through the *VEDIT dialog box. Reading the values from an ASCII file (*VREAD or *TREAD commands).
The following example shows how to define the element values for the 4x3 array parameter T2, dimensioned earlier in the *DIM examples:
The following example defines element values for the TABLE array parameter FORCE discussed earlier. FORCE(1)=0,560,560,238.5,0 FORCE(1,0)=1E-6,.8,7.2,8.5,9.3
Character array parameters can also be defined using the "=" command. Assigned values can be up to eight characters each and must be enclosed in single quotes. For example: *DIM,RESULT,CHAR,3 !Character array parameter with ! dimensions (3,1,1) !Assigns values to parameter RESULT
RESULT(1)='SX','SY','SZ'
Notice that, as when defining a numerical array parameter, the starting location of the array element must be specified (in this case, the row index number 1 is indicated). Note-CHAR cannot be used as a character parameter name because it will create a conflict with the CHAR label on the *DIM command. ANSYS will substitute the character string value assigned to parameter CHAR when CHAR is input on the third field of the *DIM command (Type field).
A spreadsheet-style editor for array element values. Navigational controls for scrolling through large arrays. An initialize function to set any row or column to a specified value (ARRAY type only). Delete, copy, and insert functions for moving rows or columns of data (ARRAY type only).
Complete instructions for using the dialog box are available from the box's Help button. Figure 3-5 An example of the *VEDIT dialog box for an ARRAY type array.
Figure 3-5 An example of the *VEDIT dialog box for a TABLE array.
You can fill an array from a data file using the *VREAD command (Utility Menu>Parameters>Array Parameters>Read from File). The command reads information from an ASCII data file and begins writing it into the array, starting with the index location that you specify. You can control the format of the information read from the file through data descriptors. The data descriptors must be enclosed in parenthesis and placed on the line following the *VREAD command. See Section 3.11.7.1 for more information about data descriptors. The data descriptors control the number of fields to be read from each record, the width of the data fields, and the position of the decimal point in the field. For example, given the following data file: 1.5 15.6 7.8 -45.6 12.3 42.5
and an array called EXAMPLE that has been dimensioned as 3 x 2, the following commands (provided as either a part or a macro or input listing) *VREAD,EXAMPLE(1,1),,,2 (3F6.1) result in
Note that the *VREAD command cannot be issued directly from the command input window. However, the Utility Menu>Parameters>Array Parameters>Read from File dialog box offers a way to specify the data descriptors and issue the command in interactive mode.
G G
The file containing the table of data can be created in a text editor or an external application (such as Microsoft Excel), but it must be in ASCII form, tab-delimited, to be read into ANSYS. You must first define the array in ANSYS, remembering to allow for the index values (0,0). The values are read straight across the rows until all columns on each row of the array are filled; ANSYS then wraps from one row to the next and begins to fill those columns, and so on. Be sure that the dimensions of the array you defined are correct. If you mistakenly define fewer columns in the ANSYS array than required, ANSYS will start filling in the next row of the array using the values remaining in the first row of the data table being read. Similarly, if you define more columns in the ANSYS array than required, ANSYS will fill all columns of the array using values from the next row of the data table being read, and only then wrap and begin filling the next row.
You can create 1-D, 2-D, and 3-D tables by reading data from an external file. Examples of how you create each of these follows.
Example 1: 1-D Table First, create the 1-D table using the application of your choice (such as a spreadsheet application, a text editor, etc.) and then save the file as a text file in tab-delimited format. In this example, the table is named "Tdata" and contains data for time vs. temperature. In its ASCII form, the table would look like this: Time Temperature Table Time Temp 0 1 2 4 20 30 70 75
In ANSYS, you define a TABLE parameter "Tt" using the *DIM command (Utility Menu>Parameters>Array Parameters>Define/Edit). Specify 4 rows and 1 column, row label of Time, and column label of Temp. Note that the data table you created has four rows and one column of data, plus the row and column index values (the first column -- TIME is the row index values) Then read in the file as described earlier, specifying 2 skipped lines. The TABLE array in ANSYS would look like this:
This same example, done via command input, would look like the following: *DIM,Tt,table,4,1,1,TIME,TEMP *TREAD,Tt,tdata,txt,,2 Example 2: 2-D Table For this example, create (in a spreadsheet application, a text editor, etc.) a 2-D table named "T2data" containing temperature data as a function of time and x-coordinate and read it into a TABLE array parameter called "Ttx." The table, in its ASCII form, would look like this: Temp (time-X-coord) Table
Time 0 0 1 2 4 0 10 15 20 30
X-Coordinate .3 15 20 25 40 .5 20 25 35 70 .7 25 35 55 90 .9 30 40 60 100
In ANSYS, you define a TABLE parameter "Ttx" using the *DIM command (Utility Menu>Parameters>Array Parameters>Define/Edit). Specify 4 rows, 5 columns, 1 plane, row label of TIME, and column label of X-COORD. Note that the data table you created has four rows and five columns of data, plus the row and column index values. Then read in the file as described earlier, specifying 2 skipped lines. The TABLE array in ANSYS would look like this:
This same example, done via command input, would look like the following: *DIM,Ttx,table,4,5,,time,X-COORD *TREAD,Ttx,t2data,txt,,2 Example 3: 3-D Table For this example, create a 3-D table named "T3data" containing temperature data as a function of time, x-coordinate, and ycoordinate and read it into a TABLE array parameter called "Ttxy." The table, in its ASCII form, would look like this: Temp (time-X-coord) Table Time 0 0 0 X-Coordinate .3 .5 20 .7 25 .9 30
10 15
1 2 4 1.5 0 1 2 4
15 20 20 25 30 40 0 .3
25 35 70 .5 30 35 45 80
35 55 90 .7 35 45 65 100
40 60 100 .9 40 50 70 120
20 25 25 30 30 35 40 50
In the example above, the bold values (in the (0,0,Z) positions) indicate the separate planes. Each plane of data, along with the row and column index values, is repeated for the separate planes. Only the plane index value and the actual data values are different. The shaded area above shows the values that change from plane to plane. In ANSYS, you define a TABLE parameter "Ttxy" using the *DIM command (Utility Menu>Parameters>Array Parameters>Define/Edit). In the case of a 3-D table, the table is dimensioned according to the number of rows, columns, and planes of data. The first column (TIME) is the row index values and the first row is the column index values. Specify 4 rows, 5 columns, 2 planes, row label of TIME, column label of X-COORD, and plane label of Y-COORD. Note that the data table you created has four rows and five columns of data in two planes, plus the row and column index values. Then read in the file as described earlier, specifying 2 skipped lines. The TABLE array in ANSYS would look like this for the second plane of data (Y=1.5):
This same example, done via command input, would look like the following: *DIM,Ttxy,table,4,5,2,TIME,X-COORD,Y-COORD *TREAD,Ttxy,t3data,txt,,2
When accessing information from the array, ANSYS will interpolate values between those explicitly set. As examples of how ANSYS interpolates values in TABLE arrays, consider the following:
Given that A is a TABLE array parameter, the ANSYS program can calculate any value between A(1) and A(2), for example
G G G
A(1.5) evaluates to 20.0 (halfway between 12.0 and 28.0) A(1.75) evaluates to 24.0 A(1.9) evaluates to 26.4
PQ(1.5,1) evaluates to -3.4 (halfway between 2.8 and -9.6) PQ(1,1.5) evaluates to 3.5 (halfway between 2.8 and 4.2) PQ(3.5,1.3) evaluates to 14.88
This feature allows you to describe a function, such as y=f(x), using a TABLE array parameter. You would use the j=0 column for values of the independent variable x and the "regular" j=1 column for values of y. Consider, for example, a timehistory forcing function described by five points as shown below. Figure 3-4 Time-History Forcing Function
You can specify this function as a TABLE array parameter whose array elements are the force values, and whose row index numbers 1 through 5 are time values 0.0 through 9.3. Schematically, the parameter will then look like this:
ANSYS can calculate (through linear interpolation) force values at times not specified in the FORCE parameter. For the above example, ANSYS will calculate a value of 89.4375 for FORCE(9). If a parameter location beyond the dimensions of
the array is used, no extrapolation is done and the end value is used. For example, ANSYS will provide a value of 560.0 for FORCE(5,2) or 0.0 for FORCE(12) You can see from these examples that TABLE array parameters can be very powerful tools in your analysis. Typical applications are time-history loading functions, response spectrum curves, stress-strain curves, material-versus- temperature curves, B-H curves for magnetic materials, and so forth. Be aware that TABLE array parameters require more computer time to process than the ARRAY type.
PARAMETER STATUS-
hi .987350000
! Lists rows 5 through 9 of XYZ ( 4 PARAMETERS DEFINED) VALUE -8.98000000 9.01000000 -30.6000000 51.0000000 -51.9000000 ! Lists parameter FORCE, includes j=0 column ( 4 PARAMETERS DEFINED)
1 1 1 1 1
*STATUS,FORCE(1),,,0 PARAMETER STATUS- FORCE LOCATION 1 0 2 0 3 0 4 0 5 0 1 1 2 1 3 1 4 1 5 1 *STATUS,T2(1,1) PARAMETER STATUS- T2 LOCATION 1 1 2 1 3 1 4 1 1 2 2 2 3 2 4 2 1 3 2 3 3 3 4 3 *STATUS,RESULT(1)
1 1 1 1 1 1 1 1 1 1
VALUE 0.000000000E+00 0.800000000 7.20000000 8.50000000 9.30000000 0.000000000E+00 560.000000 560.000000 238.500000 0.000000000E+00 ! Lists parameter T2 ( 4 PARAMETERS DEFINED)
1 1 1 1 1 1 1 1 1 1 1 1
VALUE 0.600000000 2.00000000 -1.80000000 4.00000000 7.00000000 5.00000000 9.10000000 62.5000000 2.000000000E-04 -3.50000000 22.0000000 1.000000000E-02 !Lists parameter RESULT
1 2 3
1 1 1
1 1 1
SX SY SZ
Is the width of the data field in characters. Thus, for a character field that is eight characters wide, the descriptor is A8 The following examples illustrate the *VWRITE command and data descriptors in use. Given that the MYDATA array has been dimensioned and filled with the following values:
The following short macro first defines the scalar parameter X as having a value of 25 and then opens the file vector (*CFOPEN command). The *VWRITE command then defines the data to be written to the file. In this case, the first vector written uses the SEQU keyword to provide row numbers. Note that in some cases that constants, scalar parameters, and operations that include array element values are written to the file. Note the data file contents for these items. x=25 *cfopen,vector *vwrite,SEQU,mydata(1,1,1),mydata(1,2,1),mydata(1,3,1),10.2,x,mydata(1,1,1)+3 (F3.0,' ',F8.4,' ',F8.1,' 'F8.6,' ',F4.1,' 'F4.0,' 'F8.1) *cfclos
The macro creates the following data file: 1. 2. 3. 4. 5. 6. 2.1522 2.3049 2.0105 2.3683 2.8491 2.2280 3.9 4.0 3.4 3.3 4.8 3.5 5.286370 5.409196 5.936638 5.632203 5.978024 5.546851 10.2 10.2 10.2 10.2 10.2 10.2 25. 25. 25. 25. 25. 25. 5.2 5.2 5.2 5.2 5.2 5.2
The second example uses the following previously dimensioned and filled array:
Note the use of descriptors in the following example *VWRITE command: *vwrite,SEQU,mydata(1,1),mydata(1,2),(mydata1(1,1)+mydata1(1,2)) (' Row',F3.0,' contains ',2F7.3,'. Is their sum ',F7.3,' ?') The resulting data file is Row 1. contains Row 2. contains Row 3. contains 10.000 50.000. 20.000 60.000. 30.000 70.000. Is their sum Is their sum Is their sum 60.000 ? 60.000 ? 60.000 ?
In the following example, the result array is first dimensioned (Z1). The *VOPER command then adds column 2 of X to column 1 of Y, both starting at row 1, and then places the result into Z1. Notice that the starting location (the row and column index numbers) must be specified for all array parameters. The operation then progresses sequentially down the specified vector. *DIM,Z1,ARRAY,4 *VOPER,Z1(1),X(1,2),ADD,Y(1,1)
In the following example, again the result array (Z2) is dimensioned first. The *VOPER command then multiplies the first column of X (starting at row 2) with the fourth column of Y (starting at row 1) and writes the results to Z2 (starting at row 1). *DIM,Z2,ARRAY,3 *VOPER,Z2(1),X(2,1),MULT,Y(1,4)
In this example, again the results array (Z4) is dimensioned first. The *VOPER command then performs the cross product of four pairs of vectors, one pair for each row of X and Y. The i, j, and k components of these vectors are columns 1, 2, and 3 respectively of X and columns 2, 3, and 4 of Y. The results are written to Z4, whose i, j, and k components are vectors 1, 2, and 3 respectively. *DIM,Z4,ARRAY,4,3 *VOPER,Z4(1,1),X(1,1),CROSS,Y(1,2)
In the following example, the results array (A3) is dimensioned first. The *VFUN command then raises each element in vector 2 of X to the power of 2 and writes the results to A3. *DIM,A3,ARRAY,4 *VFUN,A3(1),PWR,X(1,2),2
In this example, the results array (A4) is dimensioned. The two *VFUN commands then calculate the cosine and sine of array elements in THETA and place the results in the first and second columns, respectively, of A4. Notice that A4 now represents a circular arc spanning 90, described by seven points (whose x, y, and z global Cartesian coordinates are the
three vectors). The arc has a radius of 1.0 and lies parallel to the x-y plane at z = 2.0. *DIM,A4,ARRAY,7,3 *AFUN,DEG *VFUN,A4(1,1),COS,THETA(1) *VFUN,A4(1,2),SIN,THETA(1) A4(1,3)=2,2,2,2,2,2,2
In this example, the results array (A5) is first dimensioned. Then, the *VFUN command calculates the tangent vector at each point on the curve represented by A4, normalizes it to 1.0, and places the results in A5. *DIM,A5,ARRAY,7,3 *VFUN,A5(1,1),TANG,A4(1,1)
Two additional *VOPER operations, gather (GATH) and scatter (SCAT), are used to copy values from one vector to another based on numbers contained in a "position" vector. The following example demonstrates the gather operation. Note that, as always, the results array must be dimensioned first. In the example, the gather operation copies the value of B1 to B3 (using the index positions specified in B2). Note that the last element in B3 is 0 as this is its initialized value. *DIM,B1,,4 *DIM,B2,,3 *DIM,B3,,4 B1(1)=10,20,30,40 B2(1)=2,4,1 *VOPER,B3(1),B1(1),GATH,B2(1)
*MOPER or Utility Menu>Parameters>Array Operations>Matrix Operations Performs matrix operations on two input array parameter matrices and produces one output array parameter matrix. Matrix operations include
G G G G G
Matrix multiplication Solution of simultaneous equations Sorting (in ascending order) on a specified vector in a matrix Covariance between two vectors Correlation between two vectors
*MFUN or Utility Menu>Parameters>Array Operations>Matrix Functions Copies or transposes an array parameter matrix (accepts one input matrix and produces one output matrix). *MFOURI or Utility Menu>Parameters>Array Operations>Matrix Fourier Calculates the coefficients for or evaluates a Fourier series. The examples below illustrate the use of some of these commands. Refer to the ANSYS Commands Reference for syntactical information about these commands. This example shows the sorting capabilities of the *MOPER command. For this example, assume that the array (SORTDATA) has been dimensioned and its element values have been defined as follows:
First, the OLDORDER array is dimensioned. The *MOPER command will place the original order of the rows into OLDORDER. The *MOPER command then sorts the rows in SORTDATA so that the 1,1 vector is now in ascending order. *dim,oldorder,,5 *moper,oldorder(1),sortdata(1,1),sort,sortdata(1,1) The following array values result from the *MOPER command:
To put the SORTDATA array back into its original order, you could then issue the following command: *moper,oldorder(1),sortdata(1,1),sort,oldorder(1,1) In the following example, the *MOPER command solves a set of simultaneous equations. The following two arrays have been dimensioned and their values assigned:
The *MOPER command can solve a set of simultaneous equations for a square matrix. The equations take the form
In the case of the above arrays, the *MOPER command will solve the following set of simultaneous equations:
To solve the equations, first the results array (C) is dimensioned. Then the *MOPER command solves the equations, using A as the matrix of a coefficients and B as a vector of b values. *DIM,C,,4 *MOPER,C(1),A(1,1),SOLV,B(1) The C array now contains the following solutions.
The following example shows the *MFUN command used to transpose data in an array. For this example, assume that the array (DATA) was dimensioned and filled with the following values.
As always, the results array (DATATRAN) is dimensioned first, then the *MFUN command transposes the values and writes them to DATATRAN. *DIM,DATATRAN,,2,3 *MFUN,DATATRAN(1,1),TRAN,DATA(1,1) The following shows the results in the DATATRAN array:
status of these commands with the *VSTAT command. Most of these commands (and their corresponding GUI paths) were introduced earlier in this chapter. The others are explained in the following. With the exception of the *VSTAT command, which you cannot access directly in the GUI, all of the specification commands described below are available via menu path Utility Menu>Parameters>Array Operations>Operation Settings. Important: All specification commands are reset to their default settings after each vector or matrix operation. The following lists the available array specification commands: *VCUM Specifies whether results will be cumulative or non-cumulative (overwriting previous results). ParR, the result of a vector operation, is either added to an existing parameter of the same name or overwritten. The default is noncumulative results, that is, ParRoverwrites an existing parameter of the same name. *VABS Applies an absolute value to any or all of the parameters involved in a vector operation. The default is to use the real (algebraic) value. *VFACT Applies a scale factor to any or all of the parameters involved in a vector operation. The default scale factor is 1.0 (full value). *VCOL Specifies the number of columns in matrix operations. The default is to fill all locations of the result array from the specified starting location. *VSTAT Lists the current specifications for the array parameters. *VLEN or Utility Menu>Parameters>Array Operations>Operation Settings Specifies the number of rows to be used in array parameter operations. *VMASK or Utility Menu>Parameters>Array Operations>Operation Settings Specifies an array parameter as a masking vector. The following table lists the various specification commands and the vector and matrix array commands that they affect. *VLEN *VABS *VFACT *VCUM *VCOL NROW,NINC *VMASK
No Yes Yes Yes Yes Yes Yes Yes No Yes Yes Yes No
No Yes Yes Yes Yes Yes Yes Yes N/A No Yes Yes N/A
N/A No No N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A
No Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes
No No No Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes
No Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes
*MOPER Yes *VFILL *VFUN *VGET *VITRP *VOPER *VPLOT *VPUT *VREAD Yes Yes Yes Yes Yes No Yes Yes
The examples below illustrate the use of some of the specification commands. Refer to the ANSYS Commands Reference for syntactical information about these commands. In the following, the results array (CMPR) is dimensioned. The two *VFUN commands, in conjunction with the preceding *VMASK and *VLEN commands, then compress selected data and write them to specified locations in CMPR. The complement to the COMP operation is the EXPA operation on the *VFUN command. *DIM,CMPR,ARRAY,4,4 *VLEN,4,2
! Do next *V---- operation on four rows, ! skipping every second row *VFUN,CMPR(1,2),COMP,Y(1,1) *VMASK,X(1,3) !Use column 3 of X as a mask for next *V---! operation *VFUN,CMPR(1,3),COMP,Y(1,2)
This example uses the *VFACT command to round the values in an array vector to the number of decimal places specified
by the NUMDP scalar parameter (set to 2 in the example). The NUMDATA array has been dimensioned and filled with the following values:
numdp=2 *vfact,10**numdp *vfun,numdata(1),copy,numdata(1) *vfun,numdata(1),nint,numdata(1) *vfact,10**(-numdp) *vfun,numdata(1),copy,numdata(1) or, you can use a slightly shorter version numdp=2 *vfact,10**numdp *vfun,numdata(1),copy,numdata(1) *vfact,10**(-numdp) *vfun,numdata(1),nint,numdata(1) The resultant NUMDATA array is then
This example uses the *VLEN and *VMASK commands to find the set of prime numbers less than 100. An array, MASKVECT, is created using 1.0 to indicate that the row value is a prime number and 0.0 to indicate that the value isn't prime. The algorithm used to create the mask vector is to initialize all rows whose value is greater than 1 to 1.0 and then loop thorugh the range of possible factors, eliminating all multiples of the factor. The *VLEN command sets the row increment for performing operations to FACTOR. When the *VFILL command is processed, the row number is incremented by this value. Because the starting row is FACTOR x 2, the rows are processed by each loop in the following manner: FACTOR x 2, FACTOR x 3, FACTOR x 4, etc. *dim,maskvect,,100 *vfill,maskvect(2),ramp,1 *do,factor,2,10,1 *vlen,,factor *vfill,maskvect(factor*2),ramp,0 *enddo *vmask,maskvect(1) *dim,numbers,,100 *vfill,numbers(1),ramp,1,1 *status,numbers(1),1,10
The resultant output from the *STATUS command, showing the first 10 elements in NUMBERS is PARAMETER STATUS- NUMBERS ( (INCLUDING 5 PARAMETERS DEFINED) 2 INTERNAL PARAMETERS)
LOCATION 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1
1 1 1 1 1 1 1 1 1 1
VALUE 0.000000000E+00 2.00000000 3.00000000 0.000000000E+00 5.00000000 0.000000000E+00 7.00000000 0.000000000E+00 0.000000000E+00 0.000000000E+00
The following are example *VPLOT commands and their resulting plots. Note that since ARRAY data is unordered it is plotted as a histogram; TABLE data is ordered and is therefore plotted as a curve. The plot (below) resulted from the following command. *vplot,,arrayval(1,1),2 Figure 3-6 Example Plot
The plot (below) resulted from the following command. *vplot,,tableval(1,1),2 Figure 3-7 Example Plot
The plot (below) resulted from the following command. *vplot,table2(1),tableval(1,1),2 Figure 3-8 Example Plot
The plot (below) resulted from the following command. *vplot,tableval(1,0),tableval(1,1),2 Figure 3-9 Example Plot
You can create macros either within ANSYS itself or using your text editor of choice (such as emacs, vi, or wordpad). If your macro is fairly simple and short, creating it in ANSYS can be very convenient. If you are creating a longer, more complex macro or editing an existing macro then you'll need a text editor. Also, using a text editor allows you to use a similar macro or ANSYS log file as the source for your macro. For any long, complex macro you should always consider either using a similar macro as a starting point or running the task interactively in ANSYS and using the resulting log file as the basis of your macro. Either method can greatly reduce the time and effort required to create a suitable macro.
G G
The file name cannot exceed 32 characters. The file name cannot begin with a numeral. The file extension cannot contain more than eight characters (if you are executing the macro as if it were an ANSYS command it should have the extension .mac.) The file name or extension cannot contain spaces. The file name or extension cannot contain any characters prohibited by your file system and for portability shouldn't contain any characters prohibited by either UNIX or Windows file systems.
To ensure that you aren't using the name of an ANSYS command, before creating a macro try running the file name that you wish to use as an ANSYS command. If ANSYS returns the message shown below, you'll know that the command is not used in the current processor. To be "safe," you should check the macro file name in each processor in which you plan to use the macro. (You could also check if the macro file name matches any command listed in the online documentation; however, this method can't locate the names of undocumented commands.) Figure 4-1 ANSYS message box stating that an unknown command was issued.
Using the .mac extension allows ANSYS to execute the macro as it would any internal command. The extension .MAC is used for ANSYS internal macros and you should avoid using this.
3. The current directory. You can place macros for your personal use in your home directory. Macros that should be available across your site should be placed in the ANSYS documentation directory or some commonly accessible directory that everyone can reference through the ANSYS_MACROLIB environment variable.
G
For Windows 95 users: You must designate the "home directory" and drive using environment variables, see the ANSYS Installation and Configuration Guide for Windows. For Windows NT users: The "current directory" is the default directory (usually a network resource) set by administrators and you should ask your network administrator for its location. You can use environment variables to create a local "home directory." The local home directory is checked after the default directory designated in your domain profile. See the ANSYS Installation and Configuration Guide for Windows for more information.
Issuing the *CREATE command in the input window. Parameter values are not resolved and parameter names are written to the file. Using the *CFOPEN, *CFWRITE, and *CFCLOS commands. Parameter names are resolved to their current values and those values are written to the macro file. Choosing the Utility Menu>Macro>Create Macro menu item. This method opens a dialog box that can be used as a simple, multi-line editor for creating macros. Parameter values are not resolved and parameter names are written to the file.
As with the *CREATE command, parameters are not evaluated but are written verbatim into the macro file. Note that you do not make the last line a *END command.
./EOF For example, the following macro file contains two simple macros: mybloc /prep7 /view,,-1,-2,-3 block,,4,,3,,2 finish /EOF mysphere /prep7 /view,,-1,-2,-3 sphere,1 finish /EOF Note that each macro is prefaced with a macro name (sometimes refered to as a data block name) and ends with a /EOF command. A macro library file can reside anywhere on your system, although for convenience you should place it within the macro search path. Unlike macro files, a macro library file can have any extension up to eight characters.
*use,mymacro.mac,4,3,2,1.5 The Utility Menu>Macro>Execute Macro menu item dialog provides fields for arguments. Executing macros contained in macro libraries is similar. You must first specify the library file using the *ULIB command. For example, to specify that macros are in the mymacros.mlib file, which resides in the /myaccount/macros directory, you would issue the following command: *ulib,mymacros,mlib,/myaccount/macros/ After selecting a macro library, you can execute any macro contained in the library by specifying it through the *USE command. As with macros contained in individual files, you can specify arguments as parameters in the *USE command. Note-You can't use the *USE command to access macros not contained in the specified macro library file after issuing the *ULIB command.
A set of scalar parameters that provide a way of passing command line arguments to the macro. A set of scalar parameters that can be used within the macro. These provide a set of local variables that can be used to define values only within that macro.
Numbers Alphanumeric character strings (up to eight characters enclosed in single quotes) Numeric or character parameters Parametric expressions
Note-You can pass only the values of parameters ARG1 through AR18 to a macro as arguments with the *USE command. If you create a macro that can be used as an ANSYS command (the macro files has a .mac extension), you can pass the values of parameters ARG1 through AR19 to the macro. For example, the following simple macro requires four arguments, ARG1, ARG2, ARG3, and ARG4: /prep7 /view,,-1,-2,-3 block,,arg1,,arg2,,arg3
sphere,arg4 vsbv,1,2 finish To execute this macro, a user might enter mymacro,4,3,2.2,1
Call subroutines (nested macros). Branch unconditionally to a specified location with a macro. Branch based upon a condition to a specified location within a macro. Repeat the execution of a single command, incrementing one or more command parameters. Loop through a section of a macro a specified number of times.
The following sections detail each of these program control capabilities. For the exact syntax of the commands, refer to the ANSYS Commands Reference.
VAL1 is the first numerical value (or numerical parameter) in the comparison. Oper is the comparison operator. VAL2 is the second numerical value (or numerical parameter) in the comparison. Base is the action that occurs if the comparison evaluates as true.
APDL offers eight comparison operators, which are discussed in detail in the *IF command reference. Briefly these are: EQ Equal (for VAL1=VAL2). NE Not equal (for VAL1#VAL2).
LT Less than (for VAL1<VAL2). GT Greater than (for VAL1>VAL2). LE Less than or equal (for VAL1vVAL2). GE Greater than or equal (for VAL1>=VAL2). ABLT Absolute values of VAL1and VAL2before <operation. ABGT Absolute values of VAL1and VAL2before >operation. By giving the Base argument a value of THEN, the *IF command becomes the beginning of an if-then-else construct (similar to the FORTRAN equivalent). The construct consists of
G G G G
An *IF command, followed by One or more optional *ELSEIF commands An optional *ELSE command A required *ENDIF command, marking the end of the construct.
In its simplest form, the *IF command evaluates the comparison and, if true, branches to a label specified in the Base argument. This is similar to the "computed goto" in FORTRAN 77. (In combination, a set of such *IF commands could function similarly to the CASE statements in other programming languages.) Take care not to branch to a label within an if-then-else construct or do-loop. By setting the Base argument to a value of STOP, you can exit from ANSYS based on a particular condition. An if-then-else construct simply evaluates a condition and executes the following block or jumps to the next statement following the *ENDIF command (shown with the "Continue" comment). *IF,A,EQ,1,THEN ! Block1 . . *ENDIF ! Continue The following example shows a more complex structure. Note that only one block can be executed. If no comparison evaluates to true, the block following the *ELSE command is executed.
Figure 4-4 A sample if-then-else construct, using all of the possible APDL branching commands.
Note-You can issue a /CLEAR command within an if-then-else construct. The /CLEAR command does not clear the *IF stack and the number of *IF levels is retained. An *ENDIF is necessary to close any branching logic. Also, keep in mind that the /CLEAR command deletes all parameters, including any that are used in your branching commands. You can avoid any problems that might arise from the deletion of parameters by issuing a /PARSAV command before the /CLEAR command, and then following the /CLEAR command with a /PARRES command.
The following example do-loop edits five load step files (numbered 1 through 5) and makes the same changes in each file. *DO,I,1,5 LSREAD,I OUTPR,ALL,NONE ERESX,NO LSWRITE,I *ENDDO ! For I = 1 to 5: ! Read load step file I ! Change output controls ! Rewrite load step file I
You can add your own loop controls by using the *IF, *EXIT, or *CYCLE commands. Keep the following guidelines in mind when constructing do-loops.
G G G
Do not branch out of a do-loop with a :Label on the *IF or *GO commands. Avoid using a :Label to branch to a different line within a do-loop. Use if-then-else-endif instead. Output from commands within a do-loop is automatically suppressed after the first loop. Use /GOPR or /GO (no response line) within the do-loop if you need to see output for all loops. Take care if you include a /CLEAR command within a do-loop. The /CLEAR command does not clear the doloop stack, but it does clear all parameters including the loop parameter in the *DO statement itself. You can avoid the problem of having an undefined looping value by issuing a /PARSAV command before the /CLEAR command, and then following the /CLEAR command with a /PARRES command.
*DO
Defines the start of a "do" loop. The commands following the *DO command execute (up to the *ENDDO command) repeatedly until some loop control is satisfied.
keyboard. Don't include picking operations in a "do" loop. Take care if you include a /CLEAR command within a doloop. The /CLEAR command does not clear the do-loop stack, but it does clear all parameters including the loop parameter in the *DO statement itself. You can avoid the problem of having an undefined looping value by issuing a /PARSAV command before the /CLEAR command, and then following the /CLEAR command with a /PARRES command. You must use one *ENDDO command for each nested "do" loop. The *ENDDO and *DO commands for a loop must be on the same file.
*ENDDO
*CYCLE
When executing a "do" loop, the ANSYS program bypasses all commands between the *CYCLE command and the *ENDDO command, then (if applicable) initiates the next loop.
You can use the cycle option conditionally (via the *IF command). The *CYCLE command must appear on the same file as the *DO command and must appear before the *ENDDO command.
*EXIT
The command following the *ENDDO command executes next. The *EXIT and *DO commands for a loop must be on the same file. You can use the exit option conditionally (via the *IF command). Command format is *IF,VAL1,Oper,Val2,Base, where: VAL1 is the first numeric value (or parameter that evaluates to a numeric value) in the conditional comparison. Oper is the operation label: EQ (equal), NE (not equal), LT (less than), GT (greater than), LE (less than or equal), GE (greater than or equal), ABLT (absolute values of VAL1 and VAL2 before < operation) or ABGT (absolute values of VAL1 and VAL2 before > operation). VAL2 is the second numeric value (or numeric parameter value) in the conditional comparison. Base is an action based on the logical operation being true. (If it's false, the next line in the block is read.) Possible actions are: - :label (skips to the first line starting with the matching label) - STOP (exits from the ANSYS program)
*IF
- CYCLE (skips to the end of the current "do" loop - THEN (makes this IF an if-then-else construct) You can have up to 10 nested levels of *IF blocks. You can't jump into, out of, or within a "do" loop or an if-then-else construct to a :label line, and jumping to a :label line isn't allowed with keyboard entry. You can issue a /CLEAR command within an if-then-else construct. The /CLEAR command does not clear the *IF stack and the number of *IF levels is retained. An *ENDIF is necessary to close any branching logic. Also, keep in mind that the /CLEAR command deletes all parameters, including any that are used in your branching commands. You can avoid any problems that might arise from the deletion of parameters by issuing a /PARSAV command before the /CLEAR command, and then following the /CLEAR command with a /PARRES command. Terminates an if-then-else construct. (See the *IF discussion for details.) Creates a final, optional block separator within an if-then-else construct. (See the *IF discussion for details.)
*ENDIF
The *IF and *ENDIF commands must appear in the same file.
*ELSE
The *ELSE and *IF commands must appear in the same file.
Command format is *ELSEIF,VAL1,Oper,VAL2, where: VAL1 is the first numeric value (or parameter that evaluates to a numeric value) in the conditional comparison. Oper is the operation label: EQ (equal), NE (not equal), LT (less than), GT (greater than), LE (less than or equal), GE (greater than or equal), ABLT (absolute values of VAL1 and VAL2 before < operation) or ABGT (absolute values of VAL1 and VAL2 before > operation). VAL2 is the second numeric value (or numeric parameter value) in the conditional comparison. If Oper=EQ or NE, VAL1 and VAL2 can also be character strings (enclosed in quotes) or parameters. The *IF and *ELSEIF commands must be on the same file.
Divide line into two or more lines First keypoint number Line by keypoint sweep Fillet line between two lines First line number Fillet line number
Rotate point around two keypoints Line number First line number Line number Line number Line number First line number
LROTATE Arc by keypoint rotation LSPA LSTR LTAN SPLINE Areas A ACCAT ADRAG AFILLT AL ALLP AOFFST AROTAT ASKIN ASUB Volumes Area connecting keypoints Concatenate two or more areas Drag lines along path Fillet at intersection of two areas Area bounded by lines All loops Area offset from given area Rotate lines around axis Project line segment on an area Straight line Line at end and tangent Segmented spline
Area number Area number First area number Fillet area number Area number Area number Area number First area number
Skin surface through guiding lines First area number Area using shape of existing area Area number
Drag area pattern to create volume First volume number Volume by extruding areas Volume offset from given area First volume number Volume number First volume number
Executing an ANSYS command, whether in a macro or elsewhere, generates the parameter _STATUS. This parameter reflects the error status of that command:
G G G G
Groups geometry items into a component. Arguments are: Cname - a component name, which contains up to eight characters and must begin with a letter Entity - a four-character label identifying the type of geometry items to be grouped. Possible values are VOLU, AREA, LINE, KP (keypoints), ELEM, and NODE. Deletes a component or assembly. The Name argument identifies the entity to be deleted. Edits an existing component or assembly. The ANSYS program updates assemblies automatically to reflect deletions of lower-level or assemblies. Command arguments are: Aname - the name of the assembly to edit CMEDIT, Aname,Oper,Cnam1,... Cnam7 Oper - an operation label (ADD to add components, or DELE to remove components) Cnam1,...Cnam7 - the names of components and assemblies to be added to or deleted from the assembly. You must separate the component or assembly names with commas. Groups components and assemblies into one assembly. Once defined, an assembly can be listed, deleted, selected, or unselected using the same commands as for a component. Arguments are: CMGRP, Aname,Oper,Cnam1,... Aname - the name of the assembly. The name can have up to eight characters and must begin with a letter. Cnam8 Cnam1,...Cnam8 - the names of existing components and assemblies to be included in this assembly. You must separate the component or assembly names with commas. You can specify up to five levels of assemblies within an assembly. Lists the entities contained in a component or assembly. Name is the name of the component or assembly to be listed. If you specify no Name, the program lists all components and assemblies.
CM,Cname,Entity
CMDELE,Name
CMLIST,Name
Selects a subset of components and assemblies. Type is a label identifying the type of select operation: 1. S - select a new set; default 2. R - Reselect a set CMSEL,Type,Name 3. A - Additionally select a set and extend the current set 4. U - Unselect a set 5. ALL - Select all components 6. NONE - Unselect all components
! store new positions ! this form takes 98 sec for 100,000 nodes
*vmask,sel(1) ! this form takes 3 seconds for 100,000 nodes ! NOTE: AT 5.3 NNODE MUST be caps in the following: n,(1:NNODE),x(1:NNODE),y(1:NNODE),z(1:NNODE) x(1) = y(1) = z(1) = sel(1) = i= nnode= /go ! delete parameters (cleanup)
! resume printout
The following example macro, called bilinear.mac, evaluates two bilinear materials. This is a useful macro that can be run after solving a static analysis. Material 1 is the tension properties, and Material 2 is the compression properties. ARG1 is the number of iterations (default is 2). /nop _niter = arg1 *if,_niter,lt,2,then _Niter = 2 *endif *do,iter,1,_niter /post1 set,1,1 ar11,=elmiqr(0,14) *dim,_s1,,ar11 *dim,_s3,,ar11 etable,sigmax,s,1 etable,sigmin,s,3 *vget,_s1(1),elem,1,etab,sigmax *vget,_s3(1),elem,1,etab,sigmin *dim,_mask,,ar11 *voper,_mask(1),_s1(1),lt,0 *vcum,1 *vabs,0,1 *voper,_mask(1),_s3(1),gt,_s1(1) finish /prep7 mat,1 emod,all *vput,_mask(1),elem,1,esel mat,2 emod,all call finish _s1(1)= _s3(1)= _mask(1)= /solve
! ! ! ! ! ! ! ! ! ! ! !
call elmiqr function to get no. of elements array for element s1 array for element s3 s1 is in element table sigmax s3 is in element table sigmin get element maximum stress in s1 get element minimum stress in s3 array for mask vector true if max. stress < 0 accumulate compression elements absolute value of s3 true if abs(minstr) > maxstr
! go to prep7 for element material mods ! set all materials to tension properties
solve finish *enddo _niter= _iter= /gop ! end of iterations ! clean up iteration counters
Within an ANSYS macro, you have several ways to access components of the ANSYS graphical user interface (GUI):
G G G G G G G
You can modify and update the ANSYS toolbar (this is discussed in detail in Section ). You can issue the *ASK command to prompt a user to enter a single parameter value. You can create a dialog box to prompt a user to enter multiple parameter values. You can issue the *MSG command to have the macro write an output message. You can have the macro update or remove a status bar. You can allow the user to select entities through graphical picking from within a macro. You can call any dialog box.
Par is an alphanumeric name that identifies the scalar parameter used to store the user input. Query is the text string that ANSYS displays to prompt the user. This string can contain up to 54 characters. Don't use characters that have special meanings, such as "$" or "!". DVAL is the default value given the parameter if a user issues a blank response. This value can be either a one-to-eight character string (enclosed in single quotes) or a number. If you assign no default, a blank user response deletes the parameter.
The *ASK command prints the Query text on the screen and waits for a response. It reads the response from the keyboard except when ANSYS runs in batch mode. (In that case, the response or responses must be the next-read input line or lines.) The response can be a number, a one-to-eight character string enclosed in single quotes, a numeric or character parameter, or an expression that evaluates to a number. ANSYS then sets the value of Par to the read-in response. For example: *ask,parm1,'username (enclose the username in single quotes)'
Displays the following dialog box, then sets the parameter PARM1 to the value the user enters. Figure 5-1 An Example *ASK Dialog Box.
When you issue *ASK within a macro, ANSYS writes the user's response to File.LOG on the line following the macro name.
Between one and 10 *CSET command prompts Up to two special *CSET commands that provide a two line area for user instructions.
The command has the following syntax: MULTIPRO,'start',Prompt_Num *CSET,Strt_Loc,End_Loc,Param_Name,'Prompt_String',Def_Value MULTIPRO,'end' Where 'start' A literal string that, when encountered as the first argument, marks the beginning of the MULTIPROconstruct. The literal must be enclosed in single quotes. Prompt_Num Required only if Def_Valueis omitted from at least one *CSETcommand or if Def_Valueis set to 0. The Prompt_Numvalue is an integer equal to the number of following *CSETprompts. Strt_Loc,End_Loc The initial value for Strt_Locfor the first *CSETcommand is1, and the value for End_Locis Strt_Loc+2 (3
for the first *CSETcommand). The value of each subsequent Strt_Locis the previous End_Loc+1. Param_Name The name of the parameter that will hold either the value specified by the user or, if the user supplies no value, the value of Def_Value. 'Prompt_String' A string, which can contain up to 32 characters, which can be used to describe the parameter. This string must be enclosed in single quotes. 'end' A literal string, used as the first argument for the closing MULTIPROcommand. The following is a typical example of the MULTIPRO command. multipro,'start',3 *cset,1,3,beamW,'Enter the overall beam width',12.5 *cset,4,6,beamH,'Enter the beam height',23.345 *cset,7,9,beamL,'Enter the beam length',50.0 multipro,'end'
Up to two optional *CSET commands can be added to the construct that can provide two 64 character strings. You can use these to provide instructions to the user. The syntax for these specialized *CSET commands is *CSET,61,62,'Help_String','Help_String' *CSET,63,64,'Help_String','Help_String' Where 'Help_String' A string which can contain up to 32 characters. If you need more than 32 characters, you can use a second Help_Stringargument. The following is an example of a MULTIPRO construct using the optional help lines. Note that two Help_String arguments are used to overcome the 32 character limit. multipro,'start',3 *cset,1,3,dx,'Enter DX Value',0.0 *cset,4,6,dy,'Enter DY Value',0.0 *cset,7,9,dz,'Enter DZ Value',0.0 *cset,61,62,'The MYOFSET macro offsets the',' selected nodes along each' *cset,63,64,'of the three axes. Fill in the ',' fields accordingly.' multipro,'end'
The above construct creates the following multiple-prompt dialog box. Figure 5-2 A Typical Multiple-prompt Dialog Box.
You can check the status of the buttons by testing the value of the _BUTTON parameter. The following lists the button status values:
G G
_BUTTON=0 indicates that the OK button was pressed. _BUTTON=1 indicates that the Cancel button was pressed.
WARN Writes the message with a "WARNING" heading, and also writes it to the errors file, Jobname.ERR. Writes the message with an "ERROR" heading and also writes it to the errors file, Jobname.ERR. If this is an ANSYS batch run, this label also terminates the run at the earliest "clean exit" point.
ERROR
FATAL
Writes the message with a "FATAL ERROR" heading and also writes it to the errors file, Jobname.ERR. This label also terminates the ANSYS run immediately. Writes the message with a "NOTE" heading and displays it in the message dialog box.
UI
VAL1 through VAL8 are numeric or alphanumeric character values to be included in the message. Values can be the results of evaluating parameters. All numeric values are assumed to be double precision. You must specify the message format immediately after the *MSG command. The message format can contain up to 80 characters, consisting of text strings and predefined "data descriptors" between the strings where numeric or alphanumeric character data are to be inserted. These data descriptors are:
G
G G G
%i, for integer data. The FORTRAN nearest integer (NINT) function is used to form integers for the %I specifier.` %g, for double precision data %c, for alphanumeric character data %/, for a line break
The corresponding FORTRAN data descriptors for the first three descriptors are I9, 1PG16.9, and A8 respectively. A blank must precede each descriptor. You also must supply one data descriptor for each specified value (eight maximum), in the order of the specified values. Don't begin *MSG format lines with *IF, *ENDIF, *ELSE, or *ELSEIF. If the last non-blank character of the message format is an ampersand (&), the ANSYS program reads a second line as a continuation of the format. You can use up to 10 lines (including the first) to specify the format information. Consecutive blanks are condensed into one blank upon output, and a period is appended. The output produced can be up to 10 lines of 72 characters each (using the $/ descriptor). The example below shows you an example of using *MSG that prints a message with two integer values and one real value: *MSG, INFO, 'Inner' ,25,1.2,148 Radius ( %C) = %I, Thick = %G, Length = %I The resulting output message is as follows: Radius (Inner) = 25, Thick = 1.2, Length = 148 Note-The command /UIS,MSGPOP controls which messages a message dialog box displays when the GUI is active. See the ANSYS Commands Reference for more information about this command.
progress of an operation, a STOP button you can click on to stop the operation, or both. To define a status dialog box, issue the following command: *ABSET,Title40,Item
G
Title40 is the text string that appears in the dialog box with the status bar. The string can contain a maximum of 40 characters. Item is one of the following values: Displays the status bar with no STOP button
BAR
KILL Displays a STOP button with no status bar BOTH Displays both the status bar and STOP button To update the status bar, issue the command *ABCHECK,Percent,NewTitle.
G G
Percent is an integer between 0 and 100. It gives the position of the status bar. NewTitle is a 40-character string that contains progress information. If you specify a string for NewTitle, it replaces the string supplied in Title40.
If you specify KILL or BOTH, your macro should check the _ERROR parameter after each execution of *ABCHECK to see if the user has pressed the STOP button, then take the appropriate action. To remove the status bar from the ANSYS GUI, issue the *ABFINI command. The following example macro illustrates the status bar (complete with bar and STOP button) in use. The status dialog box that is produced is shown in the following figure. Note that the macro checks the status of the _ERROR parameter and, if the STOP button is pressed, posts the "We are stopped......" message. fini /clear,nost /prep7 n,1,1 n,1000,1000 fill *abset,'This is a Status Bar',BOTH myparam = 0 *do,i,1,20 j = 5*i *abcheck,j *if,_return,gt,0,then myparam = 1 *endif *if,myparam,gt,0,exit /ang,,j nplot,1 *if,_return,gt,0,then
myparam = 1 *endif *if,myparam,gt,0,exit nlist,all *if,_return,gt,0,then myparam = 1 *endif *if,myparam,gt,0,exit *enddo *if,myparam,gt,0,then *msg,ui We are stopped......... *endif *abfinish fini Note-Do not call *ABCHECK more than about 20 times in a loop. Figure 5-3 A Typical Status Dialog Box, Showing The Status Bar And Stop Button.
menu item. Keep in mind that many dialog boxes have a number of dependencies, including that the appropriate ANSYS processor is active and that certain required preexisting conditions are met. For example, launching a dialog box to select nodes first supposes that nodes exist, if no nodes exist the macro will fail when the user clicks OK or Apply. Note-If a macro includes GUI functions, the /PMACRO command should be the first command in that macro. This command causes the macro contents to be written to the session log file. This is important, because if you omit the /PMACRO command, ANSYS can't read the session log file to reproduce the ANSYS session.
ANSYS provides the ability to encrypt macro files so that the source is not "human-readable." Encrypted macros require an encryption key to run. The encryption key can be either explicitly placed (in readable ASCII) in the macro or it can be set by the user in ANSYS as a global encryption key.
Encryption_Key is an eight-character password. File_name is the name of the encrypted macro filename. File_ext is an optional file extension for the encrypted macro file. If you wish users to execute the macro as an "unknown" command, you should use the .mac extension. Directory_Path/ is the optional directory path that can contain up to 60 characters; you only need this argument if you don't want to write the encrypted macro file to your "home" directory. Note that you must make the "/" (or "\" for Windows systems) the final character of the path name (otherwise the last directory name is prepended to the file name).
Note the placement of the /ENCRYPT commands at the top and bottom of the listing in the following example /encrypt,mypasswd,myenfile,mac,macros/ /nopr /prep7 /view,,-1,-2,-3 block,,arg1,,arg2,,arg3 sphere,arg4 vsbv,1,2 /gopr
finish /encrypt
The /ENCRYPT command at the top of the macro instructs ANSYS to encrypt the file and use the string "mypasswd" as the encryption key. It will create an encrypted macro file called myenfile.mac and place it in the /macros subdirectory of the home directory. The /ENCRYPT command at the bottom instructs ANSYS to stop the encryption process and write the encrypted macro to the specified file. Note-The encrypted macro uses a /NOPR command as its second line to turn off echoing of ANSYS commands to the session log file. This is important if you wish to prevent users from reading the contents of the macro from the session log. It's a good practice to reactivate the session log by issuing the /GOPR command as the last command in the macro before the ending /ENCRYPT command.
Note that the individual commands within the macro are now encrypted, and that the encrypted material is enclosed by /DECRYPT commands. The encryption key is the argument to the first /DECRYPT command.
command with the parameter PASSWORD. Thus, the first line of the encrypted macro becomes /DECRYPT,PASSWORD Before executing the macro within ANSYS, issue the following command through the ANSYS Input command line /DECRYPT,PASSWORD,Encryption_Key Where Encryption_Key is the encryption key used to encrypt the file. You can now execute the encrypted password. To delete the current global encryption key, issue the following ANSYS command. /DECRYPT,PASSWORD,
1.2.5.3 Group 3 - Real Constant Information 1.2.5.4 Group 4 - Coordinate System Information 1.2.5.5 Group 5 - Nodal Locations 1.2.5.6 Group 6 - Element Information 1.2.6 Set 5 - Solution Information 1.2.6.1 Group 1 - Solution header 1.2.6.2 Group 2 - Solution Data 1.2.6.3 Group 2A - Header Extension 1.2.6.4 Group 2B Header Extension 1.2.6.5 Group 3 - Nodal Solution 1.2.6.6 Group 4 - Reaction Force Information 1.2.6.7 Group 5 - Master DOF List 1.2.6.8 Group 6 - Boundary Condition Index Table 1.2.6.9 Group 7 - Element Solutions Index Table 1.3 Description of the Reduced Displacement File 1.3.1 Set 1 - Standard ANSYS File Header 1.3.2 Set 2 - RDSP File Header 1.3.3 Set 3 - Analysis Information 1.3.3.1 Group 1 - Degrees Of Freedom Per Node 1.3.3.2 Group 2 - Nodal Equivalence Table 1.3.3.3 Group 3 - Time Information
1.3.3.4 Group 4 - Degree Of Freedom Set Used 1.3.3.5 Group 5 - Original Reduced Set Of Degrees Of Freedom Used 1.3.3.6 Group 6 - DOF Of Nodal Constraints 1.3.4 Set 4 - Reduced Matrices Data 1.3.4.1 Group 1 - Reduced Stiffness Matrix 1.3.4.2 Group 2 - Reduced Mass Matrix 1.3.4.3 Group 3 - Reduced Damping Matrix Or Mode Shapes 1.3.4.4 Group 4 - Frequencies Extracted From The Modal Analysis 1.3.5 Set 5 - Calculated Displacements 1.3.5.1 Group 1 - Calculated Displacements 1.3.5.2 Group 2 - Gap Restoring Forces 1.4 Description of the Reduced Complex Displacement File 1.4.1 Set 1 - Standard ANSYS File Header 1.4.2 Set 2 - RFRQ File Header 1.4.3 Set 3 - Analysis Information 1.4.3.1 Group 1 - Degrees Of Freedom Per Node 1.4.3.2 Group 2 - Nodal Equivalence Table 1.4.3.3 Group 3 - Unused Record 1.4.3.4 Group 4 - Degree Of Freedom Set Used
1.4.3.5 Group 5 - Original Reduced Set Of Degrees Of Freedom Used 1.4.3.6 Group 6 - DOF Of Nodal Constraints 1.4.4 Set 4 - Reduced Matrices Data 1.4.4.1 Group 1 - Reduced Stiffness Matrix 1.4.4.2 Group 2 - Reduced Mass Matrix 1.4.4.3 Group 3 - Reduced Damping Matrix Or Mode Shapes 1.4.4.4 Group 4 - Frequencies Extracted From The Modal Analysis 1.4.5 Set 5 - Calculated Displacements 1.4.5.1 Group 1 - Calculated Complex Displacements 1.5 Description of the Modal Results File 1.5.1 Set 1 - Standard ANSYS File Header 1.5.2 Set 2 - MODE File Header 1.5.3 Set 3 - Analysis Information 1.5.3.1 Group 1 - Degrees Of Freedom Per Node 1.5.3.2 Group 2 - Nodal Equivalence Table 1.5.3.3 Group 3 - Reduced Set Of Degrees Of Freedom Used 1.5.3.4 Group 4 - Frequencies (eigenvalues) 1.5.3.5 Group 5 - Participation Factors 1.5.3.6 Group 6 - Mode Coefficients
1.5.3.7 Group 7 - Modal Damping Coefficients 1.5.3.8 Group 8 - Mode Shapes (Eigenvectors) 1.5.3.9 Group 9 - Load Vector 1.5.3.10 Group 10 - Lumped Mass Vector 1.5.4 Set 4 - Reduced Matrices Data 1.5.4.1 Group 1 - Reduced Stiffness Matrix 1.5.4.2 Group 2 - Reduced Mass Matrix 1.5.4.3 Group 3 - Reduced Damping Matrix 1.5.4.4 Group 4 - Spectrum Data 1.6 Description of the Element Matrices File 1.6.1 Set 1 - Standard ANSYS File Header 1.6.2 Set 2 - EMAT File Header 1.6.3 Set 3 - Analysis Information 1.6.3.1 Group 1 - Time information 1.6.3.2 Group 2 - Degrees Of Freedom Per Node 1.6.3.3 Group 3 - Nodal Equivalence Table 1.6.3.4 Group 4 - Element Equivalence Table 1.6.3.5 Group 5 - First Element At A DOF Table 1.6.3.6 Group 6 - Last Element At A DOF Table 1.6.3.7 Group 7 - Element Index Table 1.6.4 Set 4 - Element Matrices Data
1.6.4.1 Group 1 - Element Matrix Header 1.6.4.2 Group 2 - DOF Index Table 1.6.4.3 Group 3 - Element Matrices 1.6.4.4 Group 4 - Element Force Vectors 1.7 Description of the Substructure Matrices File 1.7.1 Set 1 - Standard ANSYS File Header 1.7.2 Set 2 - SUB File Header 1.7.3 Set 3 - Substructure Information 1.7.3.1 Group 1 - Substructure Transformations 1.7.3.2 Group 2 - Degrees Of Freedom Per Node 1.7.3.3 Group 3 - Local DOF Set 1.7.3.4 Group 4 - Positions Of The Local DOF Set 1.7.3.5 Group 5 - DOF Set Of The Model As Defined During Generation Pass 1.7.3.6 Group 6 - Nodal Equivalence Table 1.7.3.7 Group 7 - Substructure Title 1.7.3.8 Group 8 - Unique Node List 1.7.3.9 Group 9 - Coordinates Of The Unique Nodes 1.7.3.10 Group 10 - Edge Of Substructure 1.7.3.11 Group 11 - Global DOF Set 1.7.4 Set 4 - Substructure Matrices
1.8 Description of the Triangularized Stiffness File 1.8.1 Set 1 - Standard ANSYS File Header 1.8.2 Set 2 - TRI File Header 1.8.3 Set 3 - Analysis Information 1.8.3.1 Group 1 Degrees Of Freedom Per Node 1.8.3.2 Group 2 Nodal Equivalence Table 1.8.4 Set 4 - Triangularized Matrix Data 1.8.4.1 Group 1 - A Row Of The Triangularized Matrix 1.8.4.2 Group 2 - Triangular Matrix Row Indices 1.8.4.3 Group 1 - Flag Record 1.8.4.4 Group 2 - Coefficients of the Constraint Equation 1.8.4.5 Group 3 - Triangularized Matrix Row 1.8.4.6 Group 4 - Triangular matrix row indices 1.8.4.7 Group 5 - Indicates The End Of The 5 Record Storage For This Row 1.8.5 Set 5 - Master Degree Of Freedom List 1.9 Description of the Full Stiffness-Mass File 1.9.1 Set 1 - Standard ANSYS File Header 1.9.2 Set 2 - FULL File Header 1.9.3 Set 3 - Analysis Information 1.9.3.1 Group 1 Degrees Of Freedom Per Node
Comparison Purposes) 2.2.1.1 Common Variables: 2.2.2 Subroutine bintrd (Demonstrates Printing a Dump of File Contents) 2.2.3 Subroutine bintwr (Demonstrates Copying Binary File Contents) 2.2.4 Subroutine wrtsub (Demonstrates Writing an ANSYS Substructure File) 2.2.5 Subroutine rdsubs (Demonstrates Reading a Substructure File) 2.2.6 Subroutine rdfull (Demonstrates Reading and Reformatting the .FULL File) 2.3 Results File Access Routines 2.3.1 Requirements for Using the Routines 2.3.2 Function rhdiqr (Retrieving Model Information from the Results File Header) 2.3.3 Function rhdget (Retrieving Analysis Information from the Results File) 2.3.4 Function rgmiqr (Retrieving Geometry Summary Information from the Results File) 2.3.5 Function rgmget (Retrieving Geometry Information from the Results File) 2.3.6 Function rlsfnd (Retrieving Data Set Numbers for Load Steps or Substeps) 2.3.7 Function rlsiqr (Retrieving Model Information From the Results File Header) 2.3.8 Function rnsget (Retrieving Nodal Solution Data from the Results File) 2.3.9 Function resget (Retrieving Element Solution Data from the Results File)
3.1 Using the CDREAD Command 3.1.1 Tips for Reading Files with CDREAD 3.2 Using the CDWRITE Command 3.2.1 Customizing Degree of Freedom Labels: the /DFLAB Command 3.3 Coded Database File Commands 3.3.1 R Command 3.3.2 LOCAL Command 3.3.3 NBLOCK Command 3.3.4 N Command 3.3.5 EBLOCK Command 3.3.6 EN Command 3.3.7 MPTEMP Command 3.3.8 MPDATA Command 3.3.9 CP Command 3.3.10 CE Command 3.3.11 M Command 3.3.12 SFE Command 3.3.13 SFBEAM Command
4.2 Pixmap Format for Graphic Display Files 4.3 Neutral Graphics File Format 4.3.1 Characters the Graphics File Uses 4.3.2 Graphics File Directives 4.3.2.1 Parameter Types for Graphics File Directives 4.3.2.2 Directive Descriptions 4.3.2.3 Color Specification 4.4 Decoding a Graphics File: an Example 4.4.1 The Example Command Stream 4.4.2 Example Graphics File Contents 4.5 The PLOT33 Program
COMMAND
path/filename.ext
ARGUMENT
Argument
command,arg1,arg2
Note-
Information that supplements the main topic being discussed, such as important tips or guidelines. Actions or situations that could cause problems, unexpected ANSYS behavior, or unexpected results. Actions or situations that can shut down ANSYS, damage files, cause loss of data, etc.
Caution:
Warning:
This guide describes the format of the various binary data files that ANSYS creates, as well as routines supplied by ANSYS that allow you to retrieve data from these files. The chapter also discusses the CDWRITEcommand and the .cdbfile that it creates, as well as the format of the neutral graphics file. The entire set of programmer's guides can be accessed online as HTML files or downloaded (in either HTML or Postscript format) through the ANSYS documentation web site, http://www.ansys.com/Documentation/Manuals/872. A list containing the complete set of available ANSYS documentation is available at http://www.ansys.com/ServSupp/Library/library.html
G G G G G G G
The following results files, in which the ANSYS program stores the results of solving finite element analysis problems: H Jobname.RST - A structural or coupled-field analysis H Jobname.RTH - A thermal analysis H Jobname.RMG - A magnetic analysis H 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 ANSYS Basic Analysis Procedures Guide.
G G G
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.
Item 10 Item 11
The ANSYS release level in integer form ("5.4" in character form) 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 Item 27 Item 28 Item 29 The system record size The maximum file length The maximum record number The number of processors assigned to this task
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)
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. The results file does not have to contain all the load cases of an analysis. A data set is used in this chapter to designate a load case. 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.
Record ID: N/A Type: Integer Number of records: 1 Record length: 100 items
The following lists the items found in the header by position. fun12 maxe maxn nelm nnod kan resmax numdof nsets ptrend
ptrend8 0 0 0
0 0 where
G G G G
0 0
0 0
0 0
0 0
G G G G G G G G G G G G G
fun12 = unit number (results file is 12) maxn = maximum node number of the model nnod = the actual number of nodes used in the solution phase resmax = the maximum number of data sets allowed on the file (defaults to 1000; minimum allowed is 10) numdof = number of DOFs per node maxe= maximum element number of the finite element model nelm = number of finite elements kan = analysis type nsets = number of data sets on the file ptrend = version 5.4 or previous files, pointer to the last record on the file ptrDSI = pointer to the data sets index table ptrTIM = pointer to the table of time values for a load step ptrLSP = pointer to the table of load step, substep, and cumulative iteration numbers ptrELM = pointer to the table of load step, substep, and cumulative iteration numbers ptrNOD = pointer to the nodal equivalence table ptrGEO = pointer to the beginning of geometry information units = unit system used: 0 - user defined units 1 - SI 2 - CSG 3 -British (using feet) 4 - British (using inches)
G G
nSector= Number of sectors for cyclic symmetry ptrEnd8 = Pointer to the end of the file (version 5.5 and later). Item 23 is the first 32 bits of this pointer and item 24 is the second 32 bits.
G G G G
Record ID: N/A Type: Integer Number of records: 1 Record length: numdof
Degree of freedom reference numbers UX=1 AX=7 UY=2 AY=8 UZ=3 AZ=9 ROTX=4 ROTY=5 ROTZ=6 AX=7 VX=10 VY =11 VZ =12 PRES=19
TEMP=20 VOLT=21 MAG=22 ENKE=23 ENDS=24 EMF=25 CURR=26 Reference numbers 13 through 18 and 27 through 32 are spares. 1.2.4.1.2 Record 2 - Nodal Equivalence Table
G G G G
Record ID: Located by the ptrNOD variable defined in Set 2 Type: Integer Number of records: 1 Record length: nnod
Most nodal data is stored in arrays equal to the number of used or reference nodes. This table equates the actual node number to the number used for storage. (baclst (i), i=1, nnod) 1.2.4.1.3 Record 3 - Element Equivalence Table
G G G G
Record ID: Located by the ptrELM variable defined in Set 2. Type: Integer Number of records: 1 Record length: nelm
Element equivalence table. The ANSYS program stores all element data in the numerical order that the SOLUTION processor solves the elements. This table equates the order number used to the actual element number.
G G G
This record contains the record pointers for the beginning of each data set. The first resmax words are the first 32 bits of the pointer and the second resmax words are the second 32 bits of the 64-bit pointer to the data set. For files less than 8GB, the second 32 bit word is zero. To create the 64-bit pointer, use the (system dependent) conversion routine: LONGPTR = largeIntGet (index(i),index(i+resmax)) where i is the load set of interest and LONGPTR is integer*8. 1.2.4.2.2 Record 2 - Time/Frequency Table
G G G G
Record ID: Located by the ptrTIM variable defined in Set 2. Type: Double-precision Number of records: 1 Record length: resmax.
This record contains the time (or frequency) values for each data set. 1.2.4.2.3 Record 3 - Data Set Identifiers
G G G G
Record ID: Located by the ptrLSP variable defined in Set 2. Type: Integer Number of records: 1 Record length: Equal to 3*resmax.
This record contains the load step, substep, and cumulative iteration numbers for each data set.
Record ID: Located by the ptrGEO variable in set 2. Type: Integer Number of records: 1 Record length: 20 items
Where:
G G G G G G G G G G G G G G G G G G G G
0 = Position not used. maxety = The maximum element type reference number in the model. maxrl = The maximum real constant reference number in the model. ndnod = The number of defined nodes in the model. nelm = The number of defined elements in the model. maxcsy = The maximum coordinate system reference number in the model. ptrETY = Pointer to the element type index table. ptrREL = Pointer to the real constant index table. ptrNLC = Pointer to the nodal point locations. ptrSYS = Pointer to the local coordinate system index table. ptrEID = Pointer to the element index table. 0 = Position not used. 0 = Position not used. 0 = Position not used. 0 = Position not used. ptrMAS = Pointer to the diagonal mass matrix. csysiz = The number of items describing a local coordinate system (usually 24). elmsiz = The maximum number of nodes that a defined element may have. etysiz = The number of items describing an element type (usually 150). rlsiz = The maximum number of items defining a real constant (0, if no real constants are defined).
Record ID: Located by ptrETY. Type: Integer Number of records: 1 Record length: Defined by maxety.
This record contains record pointers for each element type description. 1.2.5.2.2 Record 2 - Element Type Description
G G
G G
Each of these records is pointed to by a record pointer given in the record labeled ptrETY. These items are typically stored into the IELC array, and are used to determine the element type characteristics at runtime. The following items are typically of interest:
G G G G G G G
Item 1 - element type reference number Item 2 - element routine number Items 3-14 - element type option keys (keyopts) Item 34 - DOF/node for this element type. This is a bit mapping of the DOF/node. Item 61 - number of nodes for this element type (nodelm) Item 63 - number of nodes per element having nodal forces, etc. (nodfor). Item 94 - number of nodes per element having nodal stresses, etc. (nodstr). This number is the number of corner nodes for higher-ordered elements.
Record ID: Located by ptrREL. Type: Integer Number of records: 1 Record length: Defined by maxrl.
This record contains record pointers for each real constant set. 1.2.5.3.2 Record 2 - Element Real Contstant Data
G G G G
Record ID: N/A Type: Double-precision Number of records: Defined by numrl Record length: Varies
These records contain real constant data used for the elements. (See the ANSYS Elements Reference manual for values for a specific element.) Each of these records is pointed to by a record pointer given in the record labeled ptrREL. The length of these records varies for each element type (actual length is returned from routine BINRD).
G G G
This record contains the record pointers for each coordinate system set. ANSYS writes coordinate systems only if local coordinate systems were defined. If a local system was defined, the predefined global systems 1 to 2 also will be written. The global Cartesian system 0 will never be written. 1.2.5.4.2 Record 2 - Coordinate System Description
G G G G
Record ID: N/A Type: Double-precision Number of records: Defined by numcsy. Record length: Defined by csysiz.
These records contain coordinate system data for each coordinate system defined. Each of these records is pointed to by a record pointer given in the record labeled ptrSYS. The items stored in each record are as follows:
G G G G G G G
Items 1-9 are the transformation matrix. Items 10-12 are the coordinate system origin (XC,YC,ZC). Items 13-14 are the coordinate system parameters (PAR1, PAR2). Items 16-18 are the angles used to define the coordinate system. Items 19-20 are theta and phi singularity keys. Item 21 is the coordinate system type (0, 1, 2, or 3). Item 22 is the coordinate system reference number.
Record ID: Located by ptrNLC. Type: Double-precision Number of records: 1 Record length: Equal to 7*ndnod.
This group contains the node number and coordinates (in the order X,Y,Z,THXY,THYZ,THZX) of each node.
Record ID: Located by the ptrEID variable. Type: Integer Number of records: 1 Record length: Defined by nelm.
This record contains the record pointers for each element description. 1.2.5.6.2 Record 2 - Element Descriptions
G G G G
Record ID: N/A Type: Integer Number of records: Defined by nelm. Record length: number of items equal to 10+nodelm.
Each of these records is pointed to by a record pointer given in the record labeled ptrEID. The length of these records varies for each element (actual length is returned from routine BINRD). nodelm shown here is the number of nodes for this element. Its value is defined in the element type description record. The items stored in each record are as follows: mat, type, real, elnum, esys, death, solidm, shape, pexcl, 0, NODES. mat type real elnum esys NODES death
mat - material reference number type - element type number real - real constant reference number elnum - element number esys - element coordinate system death - death flag = 0 - alive = 1 - dead
G G G G
solidm - solid model reference shape - coded shape key pexcl - P-Method exclude key NODES - node numbers defining the element.
(See the ANSYS Elements Reference for nodal order of an element). 1.2.5.6.3 Record 3 - Diagonal Mass Matrix
G
G G G
Record ID: N/A Type Integer: Integer Number of Records: 1 Record Length: 100 integers nelm ncumit nnod nrf ptrRF isym mask itime
0 iter
DOFS positions 51-70 - title positions 71-90 - stitle1 dbmtim dbmdat dbfncl soltim nfldof ptrEXA Where:
G G G G
soldat ptrEXT
ptrOND ptrOEL
0 - position not used nelm - number of elements nnod - number of nodes mask - bitmask for the existence of several records. If a bit is set here, it indicates that the corresponding record exists on the file. The items in the bitmask that correspond to each record are shown in the record descriptions below. itime - loadstep
G G G G G G G G G G G
iter - iteration number ncumit - cumulative iteration number nrf - number of reaction forces maxesz nmast - number of masters ptrNSL - pointer to nodal solution ptrESL - pointer to element solution ptrRF - pointer to reaction forces ptrMST - pointer to the masters ptrBC - pointer to the boundary conditions rxtrap - key to extrapolate integration point results to nodes = 0 - move = 1 - extrapolate unless active non-linear = 2 - extrapolate always
G G G
mode - mode number of harmonic loading (nodalDia for Cyclic Symmetry) isym - symmetry condition for harmonic loading (nSector for Cyclic Symmetry) kcmplx - complex key = 0 - real = 1 - imaginary
G G G G G G G G G G G G G G
numdof - number of DOFs/nodes for this data set DOFS - DOF/node reference numbers (numdof values) title - main title (in integer form) stitle1- 1st subtitle (in integer form) dbmtim - time (in compact form) when the database was last modified dbmdat - date (in compact form) when the database was last modified dbfncl - number of times that the database was modified soltim - time (in compact form) when the solution for this data set was done soldat - date (in compact form) when the solution for this data set was done ptrOND - pointer to the ordered node list (load case files only) ptrOEL - pointer to the ordered element list (load case files only) nfldof - number of extra Flotran DOFs/nodes for this data set ptrEXA - pointer to header extension ptrEXT - pointer to header extension
The pointers in the solution data header (pointed to by the data sets index table) are relative to the pointer in the index table; e.g. the element solution data is at location ptr+ptrESL, where ptr is the 64-bit pointer from the index table. To address these records first identify the pointer offset to the file reading routine: call bioBasePut (nblk,LONGPTR)
To read the solution data header: loc = bioiqr (nblk,12) ! returns the file location of the header (loc is integer*4) call biord (nblk,loc,100,ivect(1),kbf) and the reading of the data remains unchanged, e.g. ptrESL = ivect(12) call biord (nblk,ptrESL,... The pointers in the header records in 5.5 are relative addresses. To continue reading 5.4 and earlier files (which will be detectable by noting that only resmax DSI items were read): 1. zero out the second half of the index. 2. call bioinf (nblk,12,1) ! tell the file reading routines to use absolute addressing 3. follow the code samples above.
Record ID: N/A Type: Double-precision Number of Records: 1 Record Length: 100 reals lfacto tbulk lfactn 0.0 if pmeth=1: p convergence values (positions 31-100) cptime tref 0.0 0.0
timfrq tunif
velocity-acceleration-center of if pmeth=0: load data gravity terms (positions 11-28) (positions 51-100) where
G G G G G G G G G G G
timfrq - time value (or frequency value, for a modal or harmonic analysis) lfacto - the "old" load factor (used in ramping a load between old and new values) lfactn - the "new" load factor cptime - elapsed cpu time (in seconds) tref - the reference temperature tunif - the uniform temperature tbulk - Bulk temp for FLOTRAN film coefs. 0.0 - position not used 0.0 - position not used 0.0 - position not used positions 11-13 -Linear acceleration terms
G G G G G G G
positions 14-16 - Angular velocity positions 17-19 - Angular acceleration positions 20-22 - Angular velocity about the center of gravity positions 23-25 - Angular acceleration about the center of gravity positions 26-28 - Center of gravity location if pmeth=1: positions 31-100 - P convergence values if pmeth=0: positions 51-100 - Load data position 53 - Convergence key (if 1, substep converged)
Positions 1-32 - current extra Flotran DOFs for this result set. Positions 33-64 - current extra Flotran DOF labels for this set. Extra Flotran DOF reference numbers are as follows: DENS= 1 VISC= 2 EVIS= 3 COND= 4 ECON= 5 LMD1= 6 LMD2= 7 LMD3= 8
LMD4= 9 LMD5=10 LMD6=11 EMD1=12 EMD2=13 EMD3=14 EMD4=15 EMD5=16 EMD6=17 PTOT=18 TTOT=19 PCOE=20 MACH=21 STRM=22 HFLU=23 HFLM=24 YPLU=25 TAUW=26 SPHT=27 CMUV=28 29 - 32 are spares.
Record ID: EXT Type: Integer Number of Records: 1 Record Length: 200 Integers positions 1-32 - current DOF for this result set positions 33-64 - current DOF labels for this result set positions 65-84 - The third title, in integer form positions 85-104 - The fourth title, in integer form
positions 105-124 - The fifth title, in integer form position 125 = ptrTRF if pmeth=1: positions 164-200 - p convergence specs
Record ID: NSL Type: Double-precision Number of Records: 1 Record Length: Equal to nnod*Sumdof.
The DOF solution for each node in the nodal coordinate system. The DOF order is the same as shown above in the DOF number reference table. The nodal order is the same order given above in the nodal equivalence table. If a DOF for a node isn't valid, a value of 2.0**100 is used. Note1: Sum dof = numdof+nfldof. Note2: If, upon reading of this record, there is less than nnod*Sumdof items in the record, then only a selected set of nodes were output. Another record follows (integer, less than nnod long) which contains the list of nodes for which DOF solutions are available. (bit 10 (PDBN) in mask).
This index is calculated as (N-1)*numdof+DOF, where N is-the position number of the node in the nodal equivalence table, and DOF is the DOF reference number. (bit 11 (PDBR) in mask) 1.2.6.6.2 Record 2 - Reaction forces
G G G G
Record ID: N/A Type: Double-precision Number of Records: 1 Record Length: nrf
Reaction forces. The force values are ordered according to the DOF order shown above in the DOF number reference table. (bit 11 (PDBR) in mask).
G G G G
Record ID: MST Type: Integer Number of Records: 1 Record Length: nmast
This index is calculated as (N-1)*numdof+DOF, where N is the position number of the node in the nodal equivalence table, and DOF is the DOF reference number. (bit 4 in mask)
(bit 23 (PDBBC) in mask) numdis ptrDIX ptrDIS numfor ptrFIX ptrFOR 0 0 0 0 0 0 0 where
G G G G G G G
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0
numdis - number of nodal constraints ptrDIX - pointer to the table of nodes having nodal constraints ptrDIS - pointer to nodal constraint values numfor - number of nodal input force loadings ptrFIX - pointer to the table of nodes having nodal forces ptrFOR - pointer to nodal force values positions 7-40 are unused.
Record ID: DIX Type: Integer Number of Records: 1 Record Length: numdis
This index is calculated as N*32+DOF, where N is the node number and DOF is the DOF reference number. Values are in the same order as the DOF number reference table. 1.2.6.8.2 Record 2 - Nodal Constraints
G G G G
Record ID: DIS Type: Double-precision Number of Records: 1 Record Length: 4*numdis
This record contains present and previous values (real and imaginary) of the nodal constraints at each DOF. 1.2.6.8.3 Record 3 - Nodal Input Force DOFs
G G G G
Record ID: FIX Type: Integer Number of Records: 1 Record Length: numfor
This index is calculated as N*32+DOF, where N is the node number and DOF is the DOF reference number. Values are in the same order as the DOF number reference table. 1.2.6.8.4 Record 4 - Nodal forces
G G G G
Record ID: FOR Type: Double-precision Number of Records: 1 Record Length: 4*numfor
This record contains present and previous values (real and imaginary) of the nodal input force loadings at each DOF. 1.2.6.8.5 Record 5 - Two Displacement Result Sets For Transient Solution In FLOTRAN
G G
G G
Record ID: OND Type: Integer Number of Records: 1 Record Length: nnod
This record exists for a load case file only. 1.2.6.8.7 Record 7 - Ordered Element List
G G G G
Record ID: OEL Type: Integer Number of Records: 1 Record Length: nelm
Record ID: ESL Type: Integer Number of Records: 1 Record Length: nelm
This record contains pointers to each element solution. The order of the elements is the same as the order in the element equivalence table. (bit 12 (PDBE) in mask) The solution information for each individual element is stored starting at this point in the file. The next 19 records on the file are repeated as a group nelm times (once for each element). Item nelm is defined in the file header. 1.2.6.9.1 Record 1 - Individual Element Index Table
G G G G
ptrEMS ptrENF ptrENS ptrENG ptrEGR ptrEEL ptrEPL ptrECR ptrETH ptrEUL ptrEFX ptrELF ptrEMN ptrECD ptrENL ptrEHC ptrEPT ptrESF ptrEPR ptrETB ptrECT 0 where
G G G G G G G G G G G G G G G G G G G G G G
ptrEMS - pointer to misc. data ptrENF - pointer to nodal forces ptrENS - pointer to nodal stresses ptrENG - pointer to volume and energies ptrEGR - pointer to nodal gradients ptrEEL - pointer to elastic strains ptrEPL - pointer to plastic strains ptrECR - pointer to creep strains ptrETH - pointer to thermal strains ptrEUL - pointer to euler angles ptrEFX - pointer to nodal fluxes ptrELF - pointer to local forces ptrEMN - pointer to misc. non-sum values ptrECD - pointer to element current densities ptrENL - pointer to nodal nonlinear data ptrEHC - pointer to calculated heat generations ptrEPT - pointer to element temperatures ptrESF - pointer to element surface stresses ptrEPR - pointer to face pressures(92 only) ptrETB - pointer to ETABLE items(post1 only ptrECT - pointer to contact data 0 - position not used
Note-If ptrxxx is negative, then all prtx items are zero and are not on the file. 1.2.6.9.2 Record 2 - Element Summable Miscellaneous Data
G G G G
Record ID: EMS Type: Double-precision Number of Records: 1 Record Length: varies
The contents and number of data items is element dependent. For a list of what's available, see the Output Data section for the particular element in the ANSYS Elements Reference. 1.2.6.9.3 Record 3 - Element Nodal Forces
G G G G
Record ID: ENF Type: Double-precision Number of Records: 1 Record Length: varies
This record contains the forces at each node, in the same DOF order as the DOF number reference table. For static, damping, and inertia forces, a set of forces will be repeated (as appropriate). Number of data items stored in this record can be calculated as follows: nodfor*NDOF*M, where NDOF is the number of DOFs/node for this element, nodfor is the number of nodes per element having nodal forces (defined in element type description record), and M may be 1, 2, or 3. For a static analysis, M=1 only. For a transient analysis, M can be 1, 2, or 3. 1.2.6.9.4 Record 4 - Element Nodal Component Stresses
G G G G
Record ID: ENS Type: Double-precision Number of Records: 1 Record Length: varies
This record contains the stresses at each corner node, in the order SX,SY,SZ,SXY,SYZ,SXZ,S1,S2,S3,SI,SIGE. Nodal order corresponds to the connectivity defined in the element description. Stresses can be nodal values extrapolated from the integration points or values at the integration points moved to the nodes. If an element is nonlinear, integration point values always will be written. (See item rxtrap in the solution header for the setting.) An element is considered nonlinear when either plastic, creep, or swelling strains are present.
G
For solid elements, stresses are at each corner node and the number of items in this record is nodstr*11. For shell elements, stresses are at each corner node (first at the top surface, then the bottom) and the number of items in this record is 2*nodstr*11. For layered elements (with KEYOPT(8)=0), stresses for the "first" layer are at each corner node (first at the bottom surface of the bottom layer, then at the top surface of the top layer). Stresses for the "second" layer are at each corner node (first at the bottom surface, then at the top surface for the layer with the largest failure criteria). The number of items in this record is NL*2*nodstr*11, where NL is 2 (for two layers). The second layer isn't present if failure criteria weren't used or aren't appropriate. For layered elements (with KEYOPT(8)=1), stresses for each layer are at each corner node (first at the bottom surface, then at the top surface) and the number of items in this record is NL*2*nodstr*11, where NL is the number of layers. For beam elements, the contents and number of data items is element dependent. For beam elements, see the Output Data section for the particular element in the ANSYS Elements
Reference. Note-nodstr is defined in the element type b description record. 1.2.6.9.5 Record 5 - Element Volume And Energies
G G G G
volume - the element volume energy - the element energy associated with the stiffness matrix 0.0 - position not used kenrgy - the kinetic energy (if meaningful) magnet co-energy incremental energy
Record ID: EGR Type: Double-precision Number of Records: 1 Record Length: varies
This record contains the gradients at each corner node in the order X, Y, Z. Nodal order corresponds to the connectivity defined in the element description. If this is a coupled-field analysis, the data is stored in the following order (as available): fluid, thermal (TEMP), electric (VOLT), and magnetic (AZ). Gradients can be nodal values extrapolated from the integration points or values at the integration points moved to the nodes. See item rxtrap in the solution header for the setting. The number of items in this record is nodstr*3*N, where N can be 1, 2, 3, or 4 (depending on the coupled-field conditions). Note-nodstr is defined in the element type description record. 1.2.6.9.7 Record 7 - Element Nodal Component Elastic Strains
G G G G
Record ID: EEL Type: Double-precision Number of Records: 1 Record Length: varies
This record contains strains in the same order as the nodal stresses given in the record labeled ENS. Elastic strains can be nodal values extrapolated from the integration points or values at the integration points moved to the nodes. If an element is nonlinear, integration point values always will be written. See item xtrap in the solution header for the setting. An element is considered nonlinear when either plastic, creep, or swelling strains are present. For beam elements, see the Output Data section for the particular element in the ANSYS Elements Reference. 1.2.6.9.8 Record 8 - Element Nodal Component Plastic Strains
G G G G
Record ID: EPL Type: Double-precision Number of Records: 1 Record Length: varies
Element nodal component plastic strains. Strains are in the same order as the nodal-stresses given in the record labeled ENS. Plastic strains are always values at the integration points moved to the nodes. For beam elements, see the Output Data section for the particular element in the ANSYS Elements Reference. 1.2.6.9.9 Record 9 - Element Nodal Component Creep Strains
G G G G
Record ID: ECR Type: Double Precision Number of Records: 1 Record Length: varies
Strains are in the same order as the nodal stresses given in the record labeled ENS. Creep strains are always values at the integration points moved to the nodes. For beam elements, see the Output Data section for the particular element in the ANSYS Elements Reference. 1.2.6.9.10 Record 10 - Element Nodal Component Thermal Strains
G G G G
Record ID: ETH Type: Double Precision Number of Records: 1 Record Length: varies
Strains are in the same order as the nodal stresses given in the record labeled ENS plus the element swelling strain. Thermal strains can be nodal values extrapolated from the integration points or values at the integration points moved to the nodes. If the element in nonlinear, integration point data always will be written. (An element is considered nonlinear when either plastic, creep, or swelling strains are present.) See item rxtrap in the solution header for the setting. For beam elements, see the Output Data section for the particular element in the ANSYS Elements Reference. 1.2.6.9.11 Record 11 - Element Euler Angles
G G G G
Record ID: EUL Type: Double Precision Number of Records: 1 Record Length: varies
For lower-ordered elements, rotations are at the centroid and the number of items in this record is 3. For higher-ordered elements, rotations are at each corner node and the number of items in this record is nodstr*3. For layered shells, rotations are at each corner node, plus the layer rotation angle for each layer (real constant THETA). The number of items in this record is nodstr*3+NL, where NL is the number of layers. For the layered solid, rotation angles are at the centroid, plus the layer rotation angle for each layer (real constant THETA). The number of items in this record is 3+NL.
Note-nodstr is defined in the element type description record. 1.2.6.9.12 Record 12 - Element Nodal Field Fluxes
G G G G
Record ID: EFX Type: Double-precision Number of Records: 1 Record Length: varies
This record contains the fluxes at each corner node in the order X,Y,Z. If this is a coupled field analysis, the flux data is stored in the following order: thermal, electric, magnetic. Nodal order corresponds to the connectivity defined in the element description. Fluxes can be nodal values extrapolated from the integration points or values at the integration points moved to the nodes. See item rxtrap in the solution header for the setting. The number of items in this record is nodstr*3*N, where N can be 1, 2, or 3 depending on the coupled-field conditions. Note-nodstr is defined in the element type description record. 1.2.6.9.13 Record 13 - Element Nodal Coupled-field Forces
G G G G
Record ID: ELF Type: Double-precision Number of Records: 1 Record Length: varies
This record lists the forces at each node in the order X,Y,Z. For most elements, the number of items in this record is nodfor*3. However, for the PLANE53 element, the number of items in this record is either nodfor*3 or nodstr*3. (See the description of KEYOPT(7) for PLANE53 in the ANSYS Elements
Reference.) Note-nodfor and nodstr are defined in the element type description record. 1.2.6.9.14 Record 14 - Element Non-summable Miscellaneous Data
G G G G
Record ID: EMN Type: Double-precision Number of Records: 1 Record Length: varies
The contents and number data items for this record is element dependent. See the Output Data section for the particular element in the ANSYS Elements Reference. 1.2.6.9.15 Record 15 - Element Current Densities
G G G G
This record contains the calculated current densities in the order X,Y,Z. 1.2.6.9.16 Record 16- Element Nodal Nonlinear Data
G G G G
Record ID: ENL Type: Double-precision Number of Records: 1 Record Length: varies
This record stores nonlinear data at each corner node n the order SEPL, SRAT, HPRES, EPEQ, PSV, and PLWK, followed by 4 spares.
G
For solid elements, the record contains nonlinear data at each corner node and the number of items in this record is nodstr*10. For shell elements, the record contains nonlinear data at each corner node (first at the top surface, then the bottom surface), and the number of items in this record is 2*nodstr*10. For layered elements, the record contains nonlinear data at each layer at each corner node (first at the top surface, then the bottom) and the number of items n this record is NL*2*nodstr*10, where NL = number of layers. For beam elements, the contents and number of data items in this record is element dependent. For beam elements, see the Output Data section for the particular element in the ANSYS Elements Reference.
Record ID: EPT Type: Double-precision Number of Records: 1 Record Length: varies For solid elements and SHELL41, the record contains nodal temperatures at each node and the number of items in this record is nodfor. For shell elements, except SHELL41 and SHELL91, the record contains nodal temperatures at each corner node for the top surface and the bottom surface. The number of items in this record is nodstr*2. For SHELL91, the record contains nodal temperatures at each corner node for the bottom of the bottom layer, and each succeeding interlayer surface up to the top of the top layer. The number of items in this record is (NL+1)*nodstr, where NL = number of layers. For beam elements, the contents and number of data items in this record is element dependent. See the Output Data section for the particular element in the ANSYS Elements Reference.
Note-nodfor and nodstr are defined in the element type description record. 1.2.6.9.18 Record 18 - Element Heat Generafion
G G G G
This record stores the calculated heat generation. 1.2.6.9.19 Record 19 - Element Surface Stresses
G G G G
Record ID: ESF Type: Double-precision Number of Records: 1 Record Length: nsurf*19
The length of this record is nsurf*19 where nsurf is the number of surfaces that have surface stress information. The stress information is simply repeated in the format shown below for each surface. For 2d elements: facenm area epy epz temp press epx 0.0d0 sx sy
sz 0.0d0
For 3d elements: facenm area temp press epx epy sz s2 epz epxy sx sy
For axisymmetric elements: facenm 0.0d0 temp 0.0d0 epx epy sz 0.0d0 where:
G G G G G G G G G G G G G G G
epz
epxy sx
sy 0.0d0
facenm - face number area - face area temp - face temperature press - face pressure epx - EPEL(X) - strain parallel to face epy - EPEL(Y) - strain perpendicular to face epz - EPEL(Z) epxy - EPEL(XY) epxz - EPEL(XZ) - torsion shear strain sx - S(X) - stress parallel to face sy - S(Y) - stress perpendicular to face sz - S(Z) sxy - S(XY) sxz - torsion shear stress s1 - S(1)
G G G G G
s2 - S(2) s3 - S(3) sint - S(INT) seqv - S(EQV) 0.0d0 - position not used
Record ID: EPR Type: Double-precision Number of Records: 1 Record Length: varies
This record contain the element normal pressures (one value per face). See the ANSYS Elements Reference for a description of the element face pressures. 1.2.6.9.21 Record 21 - Contact Data
G G G G
Record ID: ELT Type: Double-precision Number of Records: 1 Record Length: varies
This record stores contact data at each corner node in the order, STAT, PENE, PRES, STOTAL, and SLIDE, followed by four spaces.
0 0 0
0 0 0
0 0
0 0
fun10 - unit number (rdsp file is 10) nmrow - number of rows/columns in matrices nmatrx - number of reduced matrices on the file nmode - number of modes extracted during modal analysis (or nmrow if reduced method) numdof - number of dofs per node maxn - maximum node number wfmax - maximum wavefront lenbac - number of nodes ngaps - number of gaps ncumit - total number of iterations done during analysis kan - analysis type = 5 for reduced transient analysis 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used ptrDOF - pointer to degree of freedom set used in model ptrDNC - pointer to nodal constraints ptrSTF - pointer to the reduced stiffness matrix ptrMAS - pointer to the reduced mass matrix
G G G G G G G G G G G G G G G G
ptrDMP - pointer to the reduced damping matrix or mode shapes ptrFRQ - pointer to the frequencies ptrDSP - pointer to the calculated displacements 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used
This table equates the actual node number to the number used for storage. (baclst(i),i=1,lenbac)
dtime - the time increment 0.0 - position not used 0.0 - position not used 0.0 - position not used 0.0 - position not used 0.0 - position not used 0.0 - position not used 0.0 - position not used 0.0 - position not used timend - the final time of the analysis
Record ID: DOF Type: Integer Number of Records: 1 Record Length: nmrow
The DOFs are calculated as (N-1)*numdof+DOF, where N is the position number of the node in the nodal equivalence table and DOF is the DOF reference number given above. If the analysis uses the reduced method, the original DOF order (see next record) is rearranged so that DOFs having nodal constraints are listed first. If the analysis uses the mode superposition method (using the reduced mode extraction technique), the DOF order is the same as the original order (see next group). (l(i),i=1,nmrow)
G G G G
Record ID: N/A Type: Integer Number of Records: 1 Record Length: nmrow+1
The DOFs are calculated as (N-1)*numdof+DOF, where N is the position number of the node in the nodal equivalence table and DOF is the DOF reference number given above. If the analysis uses the reduced method, the original DOF order, plus the number of nodal constraints (nbcdsp), is stored. If the analysis uses the mode superposition method (using the reduced mode extraction technique), this record matches the previous record. The nmrow+1 entry will be zero. (lorig(i),i=1,nmrow),nbcdsp
Record ID: DNC Type: Integer Number of Records: 1 Record Length: nbcdsp
This record is present only if the analysis uses the reduced method and nbcdsp > 0 (see record at ptrDOF). These numbers are the positions in the previous record of DOFs with a nodal constraint. These are nodal constraints only on nodes that also are masters. (na(i),i=1,nbcdsp)
Record ID: STF Type: Double-precision Number of Records: nmrow Record Length: nmrow
Each row of the matrix is stored as a record. The matrix is present only if nmatrx > 0 and analysis is not using mode superposition method (using the subspace mode extraction method). Row order is the same as the DOF order in record at ptrDOF. (ak(i,j),i=1,nmrow)
Each row of the matrix is stored as a record. The matrix is present only if nmatrx > 1 and analysis is not using mode superposition method (using the subspace extraction technique). Row order is the same as the DOF order in record at ptrDOF. (am(i,j),i=1,nmrow)
Record ID: DMP Type: Double-precision Number of Records: varies Record Length: varies
If the analysis uses the reduced method, each record will be nmrow items in length. The reduced damping matrix is present only if nmatrx > 2. There will be nmrow records of this type stored here. Row order is the same as the DOF order in record at ptrDOF. If the analysis uses the mode superposition method (using the reduced mode extraction technique), each record will be nmode items in length. These records contain mode shapes (eigenvectors) of the frequencies (eigenvalues) actually used in the harmonic analysis. There will be nmode records of this type stored here, with the first N records containing the mode shapes and the other records containing zeros, where N is the number of modes actually used in the harmonic-analysis. Order corresponds to the DOF order given in record at ptrDOF. If the analysis uses the mode superposition method (using the subspace mode extraction technique), this record will not be present. (psi(i,j),i=1,nmrow) (or ac)
Record ID: FRQ Type: Double-precision Number of Records: 1 Record Length: nmrow
This record is present only if the analysis uses the mode superposition method. The first nmode values are the frequencies extracted from the modal analysis. The remaining values have no meaning. (freq(i),i=1,nmrow)
Record ID: DSP Type: Double-precision Number of Records: 1 Record Length: nmrow+5
The first nmrow entries are the displacements in the same order as the original set of DOFs (see record AFTER ptrDOF). For the last five entries: 1. Time for these displacements 2. Load step number 3. Substep number 4. Cumulative iteration number 5. Scale factor (zero if the analysis uses the reduced method). (u(i),i=1,nmrow),time,itime,iter,ncumit, scale Note-If , upon reading this record, there is less than nmrow+5 items in the record, then only a selected set of nodes were output. Another record follows (integer, less than lenbac long) which contains the list of nodes for which DOF solutions are available.
Record ID: N/A Type: Doubple-precision Number of Records: 1 Record Length: ngaps
The order of these forces corresponds to the node position order given in record at ptrDNC. This record is present only if the analysis uses the reduced method and ngaps > 0. (fgaps(i),i=1,ngaps)
See 1.1.2 for a description of this set. File number (Item 1) is 10.
Record ID: N/A Type: Integer Number of Records: 1 Record Length: 40 nmrow nmatrx nmode numdof wfmax lenbac 0 0 0 0 0 0 0 ncumit 0 0
0 0 0
0 0 0
0 0
0 0
fun10 - unit number (rfrq file is 10) nmrow - number of rows/columns in matrices nmatrx - number of reduced matrices on file nmode - number of modes extracted during modal analysis (or nmrow if reduced method) numdof - number of dofs per node maxn - maximum node number wfmax - maximum wavefront lenbac - number of nodes 0 - position not used ncumit - total number of iterations done during analysis kan - analysis type = 6 - reduced harmonic 0 - position not used 0 - position not used 0 - position not used
G G G G G G G G G G G G G G G G G G G G G G G G G G
0 - position not used 0 - position not used 0 - position not used 0 position not used 0 - position not used 0 - position not used ptrDOF - pointer to degree of freedom set used in model ptrDNC - pointer to nodal constraints ptrSTF - pointer to the reduced stiffness matrix ptrMAS - pointer to the reduced mass matrix ptrDMP - pointer to the reduced damping matrix or mode shapes ptrFRQ - pointer to the frequencies ptrDSP - pointer to the calculated displacements 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used
CURR=26
Record ID: N/A Type: Integer Number of Records: 1 Record Length: lenbac
This table equates the actual node number to the number used for storage. (baclst(i),i=1,lenbac)
The record contents are as follows: 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
Record ID: DOF Type: Integer Number of Records: 1 Record Length: nmrow
The DOFs are calculated as (N-1)*numdof+DOF, where N is the position number of the node in the nodal equivalence table and DOF is the DOF reference number given above. If the analysis uses the reduced method, the original DOF order (see next record) is rearranged so that DOFs having nodal constraints are listed first. If the analysis uses the mode superposition method (using the reduced mode extraction technique), the DOF order is the same as the original order (see next record). (l(i),i=1,nmrow)
Record ID: N/A Type: Integer Number of Records: 1 Record Length: nmrow+1
The DOFs are calculated as (N-1)*numdof+DOF, where N is the position number of the node in the nodal equivalence table and DOF is he DOF reference number given above. If the analysis uses the reduced method, the original DOF order, plus the number of nodal constraints (nbcdsp), is stored. If the analysis uses the mode superposition method (using the reduced mode extraction technique), this record matches the previous record. The nmrow+1 entry will be zero. (lorig(i),i=1,nmrow),nbcds
Record ID: DNC Type: Integer Number of Records: 1 Record Length: nbcdsp
This record is present only if the analysis uses the reduced method and nbcdsp > 0 (see record at ptrDOF). These numbers are the positions in the previous record of dofs with a nodal constraint. These are nodal constraints only on nodes that also are masters. (na(i),i=1,nbcdsp)
Record ID: STF Type: Double-precision Number of Records: 1 Record Length: nbcdsp
Each row of the matrix is stored as a record. The matrix is present only if nmatrx > 0 and analysis is not using mode superposition method (using the subspace mode extraction method). Row order is the same as the DOF order in record at ptrDOF. (ak(i,j),i=1,nmrow)
G G G
Each row of the matrix is stored as a record. The matrix is present only if nmatrx > 1 and analysis is not using mode superposition method (using the subspace extraction technique). Row order is the same as the DOF order in record at ptrDOF. (am(i,j),i=1,nmrow)
Record ID: DMP Type: Double-precision Number of Records: varies Record Length: varies
If the analysis uses the reduced method, each record will be nmrow items in length. The reduced damping matrix is present only if nmatrx > 2. There will be nmrow records of this type stored here. Row order is the same as the DOF order in record at ptrDOF. If the analysis uses the mode superposition method (using the reduced mode extraction technique), each record will be nmode items in length. These records contain mode shapes (eigenvectors) of the frequencies (eigenvalues) actually used in the harmonic analysis. There will be nmode records of this type stored here, with the first N records containing the mode shapes and the other records containing zeros, where N is the number of modes actually used in the harmonic analysis. Order corresponds to the DOF order given in record at ptrDOF. If the analysis uses the mode superposition method (using the subspace mode extraction technique), this record will not be present. (psi(i,j),i=1,nmrow) (or ac)
Record ID: FRQ Type: Double-precision Number of Records: 1 Record Length: nmrow
This record is present only for analyses using the mode superposition method (using the reduced mode extraction technique). (freq(i),i=1,nmrow)
Record ID: DSP Type: cmp Number of Records: ncumit Record Length: nmrow+5
The first nmrow entries are the displacements in the same order as the original set of DOFs (see record AFTER ptrDOF). For the last five entries: Real part 1. frequency for these values 2. load step number 3. cumulative iteration number 4. zero Imaginary part frequency increment substep number zero zero
5. scale factor (zero if the analysis uses the reduced method) zero
Note-If , upon reading this record, there is less than nmrow+5 items in the record, then only a selected set of nodes were output. Another record follows (integer, less than lenbac long) which contains the list of nodes for which DOF solutions are available.
G G
Number of Records: 1 Record Length: 40 nmrow nmatrx nmode numdof wfmax lenbac 0 nontp ldstep
fun09 maxn
lumpms extopt
SvCode kan
numitr expbeg expend nspect nSPdat ptrRDF ptrFRQ ptrPRT ptrSHP ptrLOD ptrSTF ptrMAS ptrDMP ptrCOF ptrDCF ptrLPM ptrSP1 0 0 Where
G G
0 0
0 0
G G G G G G G G G
fun09 - unit number (mode file is 9) nmrow - number of rows/columns in matrices (maxn*numdof). If extopt = 0, nmrow is the number of rows in the reduced matrices and the number of master degrees of freedom. nmatrx - number of reduced matrices on the file (applies only if extopt=0) nmode - number of modes extracted numdof - number of dof per node maxn - maximum node number (If extopt = 3 or 4, the actual number of nodes is referenced.) wfmax - maximum wavefront (Does not apply if extopt = 3 or 4.) lenbac - number of nodes 0 - position not used nontp - number of equations on the .TRI file (Does not apply if extopt = 0.) lumpms - lumped mass (Does not apply if extopt = 3 or 4.), key = 0 - default matrix type = 1 - lumped
G G
G G G G G G G G G G G G G G G G G G G G G G G
ldstep - load step number numitr - total number of cumulative iterations done during analysis. (Does not apply if extopt = 3 or 4.) expbeg - beginning of the frequency range of interest expend - end of the frequency range of interest nspect - number of spectra nSPdat - number of data items per spectrum ptrRDF - pointer to reduced degree of freedom set used in model ptrFRQ - pointer to the frequencies ptrPRT - pointer to the participation factors ptrSHP - pointer to the mode shapes (eigenvectors) ptrLOD - pointer to the load vectors ptrSTF - pointer to the reduced stiffness matrix ptrMAS - pointer to the reduced mass matrix ptrDMP - pointer to the reduced damping matrix ptrCOF - pointer to the mode coefficients ptrDCF - pointer to the modal damping coefficients ptrLPM - pointer to the diagonal mass vector ptrSP1 - pointer to the the spectrum data 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used
Record ID: N/A Type: Integer Number of Records: 1 Record Length: lenbac
This table equates the actual node number to the number used for storage. (baclst(i),i=1,lenbac)
Record ID: RDF Type: Integer Number of Records: 1 Record Length: nmrow
This record is present only if extopt = 0. The DOFs are calculated as (N-1)*NUMDOF+DOF, where N is position number of the node in the nodal equivalence table and DOF is the DOF reference number given above (l(i),i=1,nmrow) (if nmatrx>0)
G G G G
Record ID: FRQ Type: Double-precision Number of Records: 1 Record Length: nmode
Frequencies are complex if extopt=3 or 4. Numbers stored are the squares of the natural circular frequencies ( **2, where =radians/time). You can obtain the natural frequencies, f (in cycles/time), using the equation. f= /2 (freq(i),i=1,nmode)
Record ID: PRT Type: Double-precision Number of Records: 1 Record Length: nmode
Record ID: COF Type: Double-precision Number of Records: 1 Record Length: nmode
(modecf(i),i=1,nmode)
Record ID: DCF Type: Double-precision Number of Records: 1 Record Length: nmode
(dampmd(i),i=1,nmode)
G G G G
Record ID: SHP Type: Double-precision Number of Records: nmode Record Length: nmrow
Mode shapes are complex if extopt=3 or 4. If extopt=0, the mode shape order corresponds to the DOF list stored at position ptrRDF. If extopt does not equal 0, the order corresponds to the nodal equivalence table. (psi(i,j),i=1,nmrow)
Record ID: LOD Type: Double-precision Number of Records: 1 Record Length: nmrow
Record ID: LPM Type: Double-precision Number of Records: 1 Record Length: nmrow
This record is present only if lumpms=1 and nmatrix=0. It is a vector containing the mass at each node in the system. (mass(i),i=1,nmrow)
Record ID: STF Type: Double-precision Number of Records: nmrow Record Length: nmrow
Each row of the matrix is stored as a record. The matrix is present only if nmatrx > 0. Row order is the same as the DOF order stored at position ptrRDF. (ak(i,j),i=1,nmrow)
Record ID: MAS Type: Double-precision Number of Records: nmrow Record Length: nmrow
Each row of the matrix is stored as a record. The matrix is present only if nmatrx > 1. Row order is the same as the DOF order stored at position ptrRDF. (am(i,j),i=1,nmrow)
Record ID: DMP Type: Double-precision Number of Records: nmrow Record Length: nmrow
Record ID: N/A Type: Integer Number of Records: 1 Record Length: 40 nume 0 kygm 0 0 0 numdof lenu 0 kycd 0 0 0 lenbac
ptrEHD ptrIDX 0
ptrend
fun02 - unit number (emat file is 2) nume - number of elements numdof - number of dofs per node lenu - total DOFs of model lenbac - number of nodes maxn - maximum node number 0 - position not used 0 - position not used nodref - actual number of nodes referenced lumpm - lumped mass key = 0 - default matrix type
= 1 - lumped
G
G G G G
kygss - global stress stiffening matrix calculate key 0 - do not calculate 1 - calculate kygaf - global applied force vector calculate key = 0 - do not calculate = 1 - calculate
kygrf - global restoring force vector calculate key (Newton-Raphson only) = 0 - do not calculate = 1 - calculate
G G G G G G G G G
0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used
G G G G G G G G G G G G G G G
0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used ptrDOF - pointer to degrees of freedom per node used in model ptrBAC - pointer to nodal equivalence table ptrELM - pointer to element equivalence table ptrFST - pointer to first element at a DOF table ptrLST - pointer to last element at a DOF table 0 - position not used ptrEHD - pointer to the start of the element matrices ptrIDX - pointer to element matrices index table 0 - position not used ptrend - pointer to the end of the file
timval - the current time timinc - the time increment frqval - the current frequency (from a harmonic analysis) timbeg - the start time for the analysis timend - the end time for the analysis 0.0 - position not used
G G G G G G G G G G G G G G
0.0 - position not used 0.0 - position not used 0.0 - position not used 0.0 - position not used 0.0 - position not used 0.0 - position not used 0.0 - position not used 0.0 - position not used 0.0 - position not used 0.0 - position not used 0.0 - position not used 0.0 - position not used 0.0 - position not used 0.0 - position not used
Record ID: BAC Type: Integer Number of Records: 1 Record Length: lenbac
This table equates the actual node number to the number used for storage. (baclst(i),i=1,lenbac)
G G G G
Record ID: ELM Type: Integer Number of Records: 1 Record Length: nume
The ANSYS program stores all element data in the numerical order that the SOLUTION processor solves the elements. This table equates the order number used to the actual element number (eorder(i),i=1,nume)
Record ID: FST Type: Integer Number of Records: 1 Record Length: lenu
This record signifies the first element encountered at a particular DOF. (frstel(i),i=1,lenu)
Record ID: LST Type: Integer Number of Records: 1 Record Length: lenu
This record signifies the last element encountered at a particular DOF. (lastel(i),i=1,lenu)
Record ID: IDX Type: Integer Number of Records: 1 Record Length: nume
This record specifies the file location for the beginning of the data for each element. (index(i),i=1,nume)
format than is shown here. This alternate format is not documented at this time, as it is likely to change in the future.
nmrow
sskey - stress stiffening matrix key = 0 - matrix not present = 1 - matrix present
= 1 - vector used
G
nrkey - newton-raphson(restoring) load vector key (for nonlinear analyses) = 0 - vector not used = 1 - vector used
ikey - imaginary load vector key (for complex analyses) = 0 - vector not used = 1 - vector used
G G G
0 - position not used 0 - position not used nmrow - numbers/columns in matrices. If the number is negative, the matrices will be written in lower triangular form.
Record ID: N/A Type: Integer Number of Records: 1 Record Length: nmrow
This record specifies the DOF locations of this element matrix in relation to the global matrix. The index is calculated as (N-1)*NUMDOF+DOF, where N is the position number of the node in the nodal equivalence table and DOF is the DOF reference number given above.
Record ID: N/A Type: Double-precision Number of Records: varies Record Length: varies
This record is repeated for each stiffness, mass, damping, and stress stiffening matrix. If the matrix is diagonal, the length of the records will be nmrow. If the matrix is unsymmetric, the length of the records will be nmrow*nmrow. If the matrix is symmetric, only the lower triangular terms are written and the length of the records will be (nmrow)*(nmrow+1)/2.
G G G G
This record contains both the applied force vector and the (restoring or imaginary) load vector. ANSYS always writes this record.
Record ID: HED Type: Integer Number of Records: 1 Record Length: 50 nmrow nmatrx nedge wfmax lenbac kmass 0 nnod numdof kunsym nvect prtLOD
name2 lrok
ptrPOS keydim
0 name6
name5
name7 name8
fun08 - unit number (sub file is 8) nmrow - number of rows in matrices (also number of dofs in substructure) nmatrx - number of matrices on file nedge - number of edges for outline numdof - number of dofs per node maxn - maximum node number of complete model presently in database wfmax - maximum wavefront of substruct. during generation pass lenbac - number of nodes defining substructure during the generation pass nnod - number of unique nodes in the substructure having DOFs, and which define this substructure during the use pass. Also, the number of nodes having master DOFs. kunsym - unsymmetric matrix key = 0 - symmetric = 1 - unsymmetric
kstf - stiffness matrix present key = 0 - matrix is not on file = 1 - matrix is on file
kmass - mass matrix present key = 0 - matrix is not on file = 1 - matrix is on file
kdamp - damping matrix present key = 0 - matrix is not on file = 1 - matrix is on file
nvect - number of load vectors (at least 1 is required) 0 - position not used 0 - position not used sesort - DOF set sort key = 0 - numbers are not sorted = 1 - numbers are sorted in ascending order
G G G
lenlst - maximum length of DOF set for this substructure (maxn*numdof) ptrLOD - pointer to the start of the load vectors ntrans - transformed key = 0 - substructure has not been transformed >0 - substructure copied from another substructure, via either SESSYM or SETRAN
G G G G G G
ptrMAT - pointer to the start of the substructure matrices ptrXFM - pointer to the substructure transformations ptrHED - pointer to the SUB file header name1 - first four characters of the substructure file name, in integer form name2 - second four characters of the substructure file name, ininteger form lrok - large rotation key = 0 - DOF set is not valid for large rotations = 1 - DOF set is valid
trok - SETRAN rotation key = 0 - DOF set is not valid for SETRAN nodal rotation = 1 - DOF set is valid
G G G G G G G
name3 - third four characters of the substructure file name, in integer form name4 - fourth four characters of the substructure file name, in integer form ptrDOF - pointer to the DOF/node list ptrDST - pointer to the local DOF set ptrBAC - pointer to the nodes comprising the substructure ptrTIT - pointer to the title ptrNOD - pointer to the unique nodes defining the substructure
G G G G
ptrXYZ - pointer to the coordinates of the unique nodes ptrEDG - pointer to the substructure edges ptrGDF - pointer to the global DOF set thsubs - thermal key = 0 - structural = 1 - thermal
G G G G G G G
ptrPOS - pointer to the sorted substructure DOF set to the original ptrORG - pointer to the DOF set of the model during the generation pass 0 - position not used 0 - position not used 0 - position not used stfmax - maximum diagonal stiffness term (packed into an integer) keydim - dimensionality key = 1 - axisymmetric = 2 - 2-D = 3 - 3-D
G G G G G
0 - position not used name5 - fifth four characters of the substructure file name, in integer form name6 - sixth four characters of the substructure file name, in integer form name7 - seventh four characters of the substructure file name, in integer form name8 - eighth four characters of th substructure file name, in integer form
Note-name1-8 are the inexc4 representation of the 32 character filename. name1-2 and name5-8 will be "0" for pre revision 5.2 files. Note-If ntrans > 0, records from position ptrDOF to ptrGDF will be identical to the data for the copied substructure.
Record ID: XFM Type: Double-precision Number of Records: 1 Record Length: 125
(5*25 double precisions). This record has meaning only if ntrans > 0. You can define up to five levels of transformations, with 25 variables in each level. Up to the first seven variables are used as follows: If the substructure was transferred (via the SETRAN command):
G G G G G G G
1st variable - 1.0 2nd variable - nodal increment 3rd variable - reference number of coordinate system where substructure will be transferred 4th variable - reference number of coordinate system where substructure is presently defined 5th variable - x coordinate increment 6th variable - y coordinate increment 7th variable - z coordinate increment
1st variable - 2.0 2nd variable - nodal increment 3rd variable - number of coordinate component to be used in operation = 1 - x coordinate = 2 - y coordinate = 3 - z coordinate
4th variable - reference number of coordinate system to be used for symmetry operation
Record ID: DOF Type: Integer Number of Records: 1 Record Length: numdof
The following defines the degree of freedom reference numbers: UX = 1 UY = 2 UZ = 3 AY = 8 ROTX= 4 ROTY= 5 AZ = 9 VX =10
ENKE=23
Record ID: DST Type: Integer Number of Records: 1 Record Length: nmrow
This record contains degrees of freedom for this substructure of the unique nodes, as used with this substructure, in ascending order. This index is calculated as (N-1)*numdof+DOF, where N is the node number and DOF is the DOF reference number given above (lsort(i),i=1,nmrow).
Record ID: POS Type: Integer Number of Records: 1 Record Length: nmrow
This record stores the positions of the local DOF set in relation to the generated DOF set. (lposit(i),i=1,nmrow).
1.7.3.5 Group 5 - DOF Set Of The Model As Defined During Generation Pass
G G G G
Record ID: ORG Type: Integer Number of Records: 1 Record Length: nmrow
This index is calculated as (N-1)*NUMDOF+DOF, where N is the position number of the node in the nodal equivalence table and DOF is the DOF reference number given above (lorig(i),i=1,nmrow).
This group describes nodes that defined the substructure during the generation pass of the analysis. Nodal data is stored in arrays equal to the number of used or referenced nodes. This table equates the number used for storage to the actual node number. (baclst(i),i=1,lenbac).
Record ID: NOD Type: Integer Number of Records: 1 Record Length: nnod
This record describes unique nodes defining the substructure for the use pass of the analysis. These are also the nodes having master degrees of freedom. (node(i),i=1,nnod)
Record ID: XYZ Type: Double-precision Number of Records: nnod Record Length: 6
This record describes the coordinates of a unique node, in the order X, Y, Z, THXY, THYZ, and THXZ. Nodal order corresponds to that of the node list given above. (xyzang(j,i),j=1,6)
Record ID: EDG Type: Double-precision Number of Records: nedge Record Length: 6
This record contains beginning and ending locations (X1, Y1, Z1, X2, Y2, Z2 coordinates) of a straight line comprising an edge of the substructure.
Record ID: GDF Type: Integer Number of Records: 1 Record Length: nmrow
This record describes global degrees of freedom of the unique nodes in ascending order, as used during the analysis use pass. This index is calculated as (N-1)*32+DOF, where N is the node number and DOF is the DOF reference number given above (l(i),i=1,nmrow) (sorted)
LOD dp nvect nmrow This record contains the load vectors. (f(i),i=1,nmrow)
Record ID: N/A Type: integer Number of Records: 1 Record Length: 20 nontp nmast 1 kan
fun11
wfmax lenbac numdof ptrMST ptrend lumpm keyuns ptrMS1 ptrMS2 ptrEN1 ptrEN2 0 where
G G G G G G G G G
ptrTRI 0
fun11 - unit number (tri file is 11) nontp - number of equations on file nmast - number of master dofs 1 - position not used, always = 1 kan - analysis type wfmax - maximum wavefront lenbac - number of nodes numdof - number of degrees of freedom (DOF) per node ptrMST - 32 bit pointer to the master dof list, only here for backward compatibility. Do not use if ptrMS1 or ptrMS2 are non-zero. ptrend - 32 bit pointer to the end of file only here for backward compatibility. Do not use if ptrEN1 or ptrEN2 are non-zero. lumpm - lumped mass key = 0 - default matrix type = 1 - lumped
keyuns - unsymmetric key = 0 - the matrix is not unsymmetric = 1 - the matrix is unsymmetric
ptrMS1, ptrMS2 - These two values are two halves of a 64 bit pointer that points to the master
G G G G G
DOF list ptrEN1, ptrEN2 - These two values are two halves of a 64 bit pointer that points to the end of file 0 - position not used 0 - position not used ptrTRI - pointer to the beginning of the triangularized matrix data 0 - position not used
Record ID: N/A Type: Integer Number of Records: 1 Record Length: numdof UY = 2 UZ = 3 AY = 8 ROTX= 4 ROTY= 5 AZ = 9 VX =10
UX = 1
Record ID: N/A Type: Integer Number of Records: 1 Record Length: lenbac
This table equates the actual node number to the number used for storage. (baclst(i),i=1,lenbac)
and there are two different storage options for writing a row. If the row being written does not have a constraint equation associated with it, then two records are written to describe the row. If the row being written has a constraint equation associated with it, then five records are written to describe the row. Both formats are shown below. These groupings of two or five records per row will be written a total of nontp times (to include all rows) The next two descriptions show the format for a row that does not have a constraint equation associated with it:
Record ID: N/A Type: Double-precision/complex Number of Records: 1 Record Length: varies
If keyuns=0, this record will contain the non diagonal terms of this column, the diagonal term itself, the normalized F term, followed by the reciprocal of the row pivot. If keyuns=1, this record will contain the non-diagonal terms of this column, the diagonal term itself, the normalized F term, the reciprocal of the row pivot, followed by the non-diagonal terms of this row. The length of this record will vary (actual length is returned from routine BINRD). If kan=3, this record contains complex information, otherwise it contains double-precision information. (ktri(i),i=1,n),vload,diag (symmetric) - (ktri(i),i=1,n), vload, diag,(utri(i),i=1,n) -(unsymmetric)
Record ID: N/A Type: Integer Number of Records: 1 Record Length: varies
The first item signifies what term in the row belongs to the pivot. The second term signifies what DOF is being eliminated, and the remaining items signify the new DOFs being introduced (if any). The length of this record will vary (actual length is returned from routine BINRD). (lll(i),i=1,m) The next five descriptions show the format for a row that has a constraint equation associated with it.
Indicates that constraint equations are being stored, and that the storage is shown here. Both values are TINY.
Record ID: N/A Type: Double-precision Number of Records: 1 Record Length: varies
The length of this record will vary (actual length is returned from the routine BINRD). (coeff(i), i=1, n+2)
Record ID: N/A Type: Double-precision/Complex Number of Records: 1 Record Length: varies
If keyuns=0, this record will contain the non diagonal terms of this column, the diagonal term itself, the normalized F term, followed by the reciprocal of the row pivot. If keyuns=1, this record will contain the non-diagonal terms of this column, the diagonal term itself, the normalized F term, the reciprocal of the row pivot, followed by the non-diagonal terms of this row. The length of this record will vary (actual length is returned from routine BINRD). If kan=3, this record contains complex information, otherwise it contains double-precision information. (ktri(i),i=1,n),vload,diag (symmetric) - (ktri(i),i=1,n), vload, diag, (utri(i),i=1,n) -(unsymmetric)
Record ID: N/A Type: Integer Number of Records: 1 Record Length: varies
The first item signifies what term in the row belongs to the pivot. The second term signifies what DOF is being eliminated, and the remaining items signify the new DOFs being introduced (if any). The length of this record will vary (actual length is returned from routine BINRD). (lll(i),i=1,m)
1.8.4.7 Group 5 - Indicates The End Of The 5 Record Storage For This Row
G G G G
It is included for situations when the file is being read from the bottom up. Its contents:
G G G
-cenum: n cenum: the constraint equation number for the constraint equation stored above n: the length of a row of the matrix being written
Record ID: MST or MS1, MS2 Type: Integer Number of Records: 1 Record Length: nmast
This record is present only if nmast > 0. This index is calculated as (N-1)*NUMDOF+DOF, where N is the position number of the node in the nodal equivalence table, and DOF is the DOF reference number given above.
fun04
wfmax lenbac numdof ptrend ptrend lumpm jcgeqn jcgtrm keyuns extopt jcgnmx sclstf nxrows ptrIDX 0 0 0 0 0 0 0 0 0
0 0 0
0 0 0
fun04 - unit number (full file is 4) nontp - number of equations on file nmrow - number of rows in matrices nmatrx - number of matrices on file kan - analysis type wfmax - maximum wavefront lenbac - number of nodes numdof - number of dofs per node ptrend - pointer to end of file ptrend - pointer to end of file lumpm - lumped mass key = 0 - default matrix type = 1 - lumped
G G G
jcgeqn - number of jcg equations jcgtrm - number of coefficients in sparce jcg storage keyuns - unsymmetric key = 0 - no unsymmetric matrices on file = 1 - there is at least one unsymmetric matrix on file
extopt - mode extraction method = 0 - reduced = 1 - lumped = 3 - unsymmetric Lanczos = 4 - damped Lanczos = 6 - block Lanczos
G G G G G G G G G G G G G G G G G G G G G G G G G
jcgnmx - currently not used. This position reserved for future development. sclstf - scale factor for matrices nxrows - the maximum rank for this solution ptrIDX - pointer to the matrix row indices. 0 - position not used ncefull- Number of constraint equations on the full file ncetrm - Total number of terms in the constraint equations 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used 0 - position not used
G G G
Type: Integer Number of Records: 1 Record Length: numdof UY = 2 UZ = 3 AY = 8 ROTX= 4 ROTY= 5 AZ = 9 VX =10
UX = 1
Record ID: N/A Type: Integer Number of Records: 1 Record Length: lenbac
This table equates the actual node number to the number used for storage. (baclst(i),i=1,lenbac)
Record ID: IDX Type: Integer Number of Records: 1 Record Length: varies
The first item signifies what term in the row belongs to the pivot. The second term signifies what DOF
is being eliminated, and the remaining items signify the new DOFs being introduced (if any). The length of this record will vary (actual length is returned from routine BINRD) (lll(i),i=1,m) 1.9.3.3.2 Record 2 - A Second Level Of Indexing For The Matrix
G G G G
Record ID: N/A Type: Integer Number of Records: 1 Record Length: varies
Indicates positions and values of terms to be reduced. The length of this record will vary (actual length is returned from routine BINRD) (index(i),i=1,n) for compressed rows 1.9.3.3.3 Record 3 - Stiffness Matrix
G G G G
Record ID: N/A Type: Double-precision/Complex Number of Records: 1 Record Length: varies
If keyuns=0, this record will contain the non-diagonal terms of this column, the diagonal term itself, followed by the normalized F term. If keyuns=1, this record will contain the non-diagonal terms of this column, the diagonal term itself, the non-diagonal terms of this row, followed by the normalized F term. If lumpm = 1, then the mass for this node is located after the F term. The length of this record will vary (actual length is returned from routine BINRD) (krow(i),i=1,n), vload, (mass) (symmetric) (n-1 column) diag (n-1 row) load (dmass) (unsymmetric) 1.9.3.3.4 Record 4 - Mass Matrix
G G G G
Record ID: N/A Type: Double-precision/Complex Number of Records: 1 Record Length: varies
If keyuns=0, this record will contain the non-diagonal terms of this column, the diagonal term itself, followed by the normalized F term. If keyuns=1, this record will contain the non-diagonal terms of this column, the diagonal term itself, followed by the non-diagonal terms of this row.
The length of this record will vary (actual length is returned from routine BINRD) (mrow(i),i=1,n) (symmetric) (n-1 column) diag (n-1 row) (unsymmetric) 1.9.3.3.5 Record 5- Damping Matrix
G G G G
Record ID: N/A Type: Double-precision/Complex Number of Records: 1 Record Length: varies
This record exists only if nmatrx > 2. If keyuns=0, this record will contain the non-diagonal terms of this column, the diagonal term itself, followed by the normalized F term. If keyuns=1, this record will contain the non-diagonal terms of this column, the diagonal term itself, followed by the non-diagonal terms of this row. The length of this record will vary (actual length is returned from routine BINRD) (ceqn(i),i=1,n) (symmetric) (n-1 column) diag (n-1 row) (unsymmetric)
2.1.3 Abbreviations
The input and output for the routines discussed in this chapter are described with the following abbreviations:
G
Type of variable is one of the following: 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
c c c
c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c
key
or zero (see below) (int,sc,in) - key for information requested nblk = 0 - return information about system/file key = 1 - return system block size = 2 - return number of integers per dp = 3 - return filename length nblk > 0 - return information about this block key = 1 - return fortran unit number = 2 - retrun number of blocks in file = 3 - return length of page in 32 bit words = 4 - return open status biniqr = 0 - file close = 1 - file open = 5 - return file format biniqr = 0 - internal format = 1 - external format = 6 - return read/write status biniqr = 0 - both read & write = 1 - read = 2 - write = 7 - return current position on file = 8 - return maximum length of file (in words) = 9 - return starting word for this page in buffer
2.1.7 Function binset (Opening a Blocked Binary File or Initializing Paging Space)
c c c c c c 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 note: BIO_MAXFILES is 9 BIO_MAXBLOCKS is 16 c c input arguments: c variable (typ,siz,intent) description c nblk (int,sc,in) - block number (1 to BIO_MAXFILES max) c ntap (int,sc,in) - fortran unit number for the file c (if 0, bit bucket) function binset (nblk,ntap,keyrw,istart,paglen,npage, x pname,nchar,kext,buffer) *** primary function: initialize paging space for a blocked binary file. binset should be used to open a blocked file before binrd or binwrt are used. binclo should be used to close the file. --- This routine is intended to be used in standalone programs. --- This routine should not be linked into the ANSYS program.
c c c c c c c c c c c c c c c c c c c c c c c c c c c
keyrw
(int,sc,in)
istart
paglen
buffer
- read/write flag = 0 - both read & write = 1 - read = 2 - write (int,sc,in) - starting location in buffer array usually 1 for nblk=1, paglen*npage+1 for nblk=2,etc. (int,sc,in) - page length in integer*4 words for external files or page length in integer*(IBYT) words for internal files paglen should always be a multiple of 512 words for efficiency (int,sc,in) - number of pages (1 to BIO_MAXBLOCKS max) (chr,ar(*),in) - name of the file (int,sc,in) - number of characters in the file name(<=50) (int,sc,in) - internal/external format flag = 0 - internal format = 1 - external format (int,ar(*),inout) - work array for paging, should be dimensioned to paglen*npage*nblk (max)
buffer
description - error status = 0 - no error <>0 - error occurred (int,ar(*),inout) - work array for paging
2.1.8 Subroutine bintfo (Defining Data for a Standard ANSYS File Header)
c c c c c c c c c c c c c c c c c c c c c c subroutine bintfo (title,jobnam,units,code) *** primary function: set information necessary for binhed --- This routine is intended to be used in standalone programs. --- This routine should not be linked into the ANSYS program. *** Notice - This file contains ANSYS Confidential information *** typ=int,dp,log,chr,dcp siz=sc,ar(n) intent=in,out,inout
input arguments: variable (typ,siz,intent) description title (chr*80,ar(2),in) - main title and 1st subtitle jobnam (chr*8,sc,in) - Jobname units (int,sc,in) - units = 0 - user defined units = 1 - SI = 2 - CGS = 3 - British, using feet = 4 - British, using inches code (int,sc,in) - code defining 3rd party vendor (contact ANSYS, Inc. for code assignment) output arguments:
none
c 41 c 61 c 100 c
20 20 1
main title - 20 4-character strings first subtitle - 20 4-character strings 654321 (undocumented) for an ansys file
description - block number (as defined with subroutine binset) (int,sc,inout) - current pointer to buffer (int,sc,inout) - expected record length (int,ar(*),inout) - work array for paging, should be the same array as used in binset
output arguments: variable (typ,siz,intent) loc (int,sc,inout) leng (int,sc,inout) ivect kbfint
buffer
description - new pointer to buffer - actual record length = 0 - end of file was reached (int,ar(*),in) - vector containing record read (int,sc,out) - dp or integer flag = 0 - double precision buffer > 0 - length of integer buffer (int,ar(*),inout) - work array for paging
c c c c c c c c c c c
kbfint
(int,sc,in)
buffer
- dp/integer flag = 0 - double precision buffer > 0 - length of integer buffer (int,ar(*),inout) - work array for paging, should be the same array as used in binset on this block
output arguments: variable (typ,siz,intent) description loc (int,sc,inout) - new location in buffer array ivect (int,ar(*),out) - vector containing record to be written buffer (int,ar(*),inout) - work array for paging
c *** Notice - This file contains ANSYS Confidential information *** c c c c c c c c c c c typ=int,dp,log,chr,dcp siz=sc,ar(n) intent=in,out,inout
description - externally formatted integer form of 4-character strings - number of strings to convert
c c c c c c c c c
(int,sc,in)
#include "impcom.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 nblk (int,sc,in) - the block number to close c (as defined with subroutine binset) c stat (chr,sc,in) - keep or delete flag c = 'K' - keep file c = 'D' - delete file c buffer (int,ar(*),inout) - work array for paging, should be the c same array as used in binset c c output arguments: c variable (typ,siz,intent) description c buffer (int,ar(*),inout) - work array for paging
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.
Note-The bintst program is not part of the binlib.a library. It is included here only to aid you.
COMMON/BINTCM/ IOUT,INTPDP,LENFNM,RECLNG Iout is the output unit number. Intpdp is the number of integers per double precision word. Lenfnm is the number of characters in the filename.
c *** Notice - This file contains ANSYS Confidential information *** c c c c c c c c c c c c c c ********************************************************************* * Program to write ANSYS substructure file with usrsub. To be * * used as a base for 3rd party companies to create their routines * * for writing the file. * ********************************************************************* * This program is for use in ANSYS Rev 5.x * ********************************************************************* input arguments: jobnam jobname of problem pname name of substructure file to be created units units of the problem 0 - user defined 1 - si 2 - csg
c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c
nmat
nodes(nrow) direct(nrow)
ldof(nrow) k(nrow,nrow) m(nrow,nrow) c(nrow,nrow) g(nrow,nrow) for(nrow) title nodlst(nnod) xyzang(6,nnod) output arguments:
3 - british using feet 4 - british using inches number of matrices: 1 - stiffness only 2 - stiffness and mass 3 - stiffness, mass, and damping 4 - stiffness, mass, damping, and stress stiffness number of rows in substructure matrices number of load vectors number of unique nodes 0 - symmetric matrices 1 - unsymmetric matrices 0 - structural substructure 1 - thermal substructure dimensionality key 1 - axisymmetric 2 - 2d 3 - 3d list of substructure nodes BY row list of substructure degrees of freedom by row (4 characters, upper case, left justified) (see idhed for possibilities) scratch array of integer DOF numberS stiffness matrix (symmetric) mass matrix (symmetric) damping matrix (symmetric) stress stiffening matrix (symmetric) matrix of load vectors (one column per vector) title for substructure array of unique nodes (order is insignficant) node locations in nodlst order none
2.2.6 Program rdfull (Demonstrates Reading and Reformatting the .FULL File)
Subroutine 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. If you want to use the rdfull subroutine, be sure to define your analysis as modal by issuing the command ANTYPE,2. You also need to specify full subspace mode; to do so, issue the command MODOPT,SUBSP,nmode,0,0, ,OFF. (The nmode argument isn't used; it can be any value.) If you want to use the free stiffness and mass matrices, make sure that there are no constraints on your model.
2.3.2 Function rhdiqr (Retrieving Model Information from the Results File Header)
function rhdiqr (maxn,nnod,maxds,numdof,maxe,nelm,antyp,nsets, x iwork) c *** primary function: read a results file header and return model c information 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) intent=in,out,inout c c input arguments: c variable (typ,siz,intent) description c iwork (int,ar(*),inout) - work array for paging when reading file c (should be the same array used with c subroutine binset) c c output arguments: c variable (typ,siz,intent) description c rhdiqr (int,func,out) - error flag c = 0 - no errors c = 1 - error on reading header c maxn (int,sc,out) - max node no c nnod (int,sc,out) - no of nodes c maxds (int,sc,out) - maximum no. of data sets c numdof (int,sc,out) - no of dof/node c maxe (int,sc,out) - max elem no c nelm (int,sc,out) - no of elements c antyp (int,sc,out) - analysis type c nsets (int,sc,out) - no of data sets on file c Note-You must use this routine first to set the required pointers to data in the results file.
2.3.3 Function rhdget (Retrieving Analysis Information from the Results File)
function rhdget (key,iarry,iwork) c *** primary function: return information from a results file header 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) intent=in,out,inout c c input arguments: c variable (typ,siz,intent) description c key (int,sc,in) - type of information requested c = 1 - return number dof/node c = 2 - return node order list c = 3 - return element order list c iwork (int,ar(*),inout) - work array for paging when reading file c should be same array used in binset c c output arguments: c variable (typ,siz,intent) description c rhdiqr (int,func,out) - status of info get c > 0 - number of items returned c = 0 - error on retrieving data c iarry (int,ar(*),out) - requested information Note-You must use this routine first to set the required pointers to data in the results file.
2.3.4 Function rgmiqr (Retrieving Geometry Summary Information from the Results File)
function rgmiqr (maxet,maxrl,maxcs,csysiz,nodelm,etysiz,rlsiz, x iwork) c *** primary function: return information from the results file c geometry header c *** secondary functions: node 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 iwork (int,ar(*),inout) - work array for paging when reading file c c output arguments: c variable (typ,siz,intent) description c rgmiqr (int,func,out) - error flag c = 0 - no errors c = 1 - error in reading file c maxet (int,sc,out) - max no of element types
c c c c c c
max no of real const sets max no of coordinate systems no of items describing a coord system max no of nodes for any defined element no of items describing an element type no of items in a real const set
2.3.5 Function rgmget (Retrieving Geometry Information from the Results File)
function rgmget (key,num,iarry,ivect,iwork) c *** primary function: return information from a results file c geometry record 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) intent=in,out,inout c c input arguments: c variable (typ,siz,intent) description c key (int,sc,in) - type of information requested c = 1 - return element type data c = 2 - return real const data c = 3 - return coordinate system data c = 4 - return nodal points coordinates and c rotation angles c = 5 - return element data c num (int,sc,in) - number of entity for which you want c information. i.e. num=3 returns info about c the 3rd element type, real const set, cs, etc. c for key=4, num will be ignored c ivect (int,ar(*),inout) - work array for reading indices c iwork (int,ar(*),inout) - work array for paging when reading file c c output arguments: c variable (typ,siz,intent) description c rgmget (int,func,out) - > 0 - number of items returned c = 0 - no information found c =-1 - error c iarry (int,ar(*),out) - requested information
2.3.6 Function rlsfnd (Retrieving Data Set Numbers for Load Steps or Substeps)
function rlsfnd (key,ls,iter,timfrq,kcmplx,ivect,iwork) c *** primary function: given a load step/substep nos, cumlative c iteration no, or a time/freq, return the c data set number c c *** Notice - This file contains ANSYS Confidential information *** c
c c c c c c c c c c c c c c c c c c c c c c c c c
siz=sc,ar(n)
intent=in,out,inout
ls iter
(int,sc,in) (int,sc,in)
timfrq kcmplx
(dp,sc,in) (int,sc,in)
ivect iwork
(int,ar(*),inout) (int,ar(*),inout) -
description search key = 1 - search by load step/substep nos = 2 - search by cumlative iter no = 3 - search by time/freq load step no (used only for key=1) iteration number key = 1 - substep no = 2 - cumlative iter no time/freq value complex key = 0 - return real solution = 1 - return imaginary solution working array for reading indices work array for paging when reading file
description - info about the = 0 - data set > 0 - data set < 0 - error in
2.3.7 Function rlsiqr (Retrieving Model Information From the Results File Header)
function rlsiqr (dsno,lstep,itter,ncumt,time,nrf,nnc,nnf,nmas, mode,isym,kcmplx,numdof,nconv,title,ivect,iwork,stitle) c *** primary function: return information from the result file'S c load step header 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 dsno (int,sc,in) - data set no. c ivect (int,ar(*),inout) - work array for reading data set index c iwork (int,ar(*),inout) - work array for paging when reading file c c output arguments: c variable (typ,siz,intent) description c rlsiqr (int,func,out) - error flag c = 0 - no error c = 1 - error c lstep (int,sc,out) - load set no. c itter (int,sc,out) - iteration no. c ncumt (int,sc,out) - cumulative iteration no. c time (dp,sc,out) - time c nrf (int,sc,out) - no. of reaction forces x
c c c c c c c c c c c c
numdof nconv
(int,sc,out) (int,sc,out)
title stitle
(chr*80,sc,out) (chr*80,sc,out)
no. of master dofs mode no. for harmonic loading symmetry conditon for harmonic loading complex key = 0 - real solution = 1 - imaginary solution no. of dof/node for this load set convergence key = 0 - no convergence for this load step = 1 - this load step converged title for this load set subtitle for thie load set
2.3.8 Function rnsget (Retrieving Nodal Solution Data from the Results File)
function rnsget (dsno,key,iarry,ivect,iwork) c *** primary function: returns a load case'S NODAL DATA FROM THE c results file 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 dsno (int,sc,in) - data set no. c key (int,sc,in) - type of data requested c = 1 - return dof/node list c = 2 - return react force nodes & dof id c = 3 - return react force values c = 4 - return nodal constraints nodes & dof id c = 5 - return nodal const values c = 6 - return input nodal forces nodes & dof id c = 7 - return input nodal forces values c = 8 - return master dof nodes & dof id c = 9 - return nodal solution c ivect (int,ar(*),inout) - work array for reading data set indix c iwork (int,ar(*),inout) - work array for paging when reading file c c output arguments: c variable (typ,siz,intent) description c rnsget (int,func,out) - status of read c =-1 - error on read c = 0 - no info found c > 0 - number of items found c iarry (int,ar(10),out) - requested information c
2.3.9 Function resget (Retrieving Element Solution Data from the Results File)
function resget (dsno,key,elem,darry,ivect,iwork) c *** primary function: returns a load case's element data from the c results file 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 dsno (int,sc,in) - data set no. c key (int,sc,in) - type of data requested c = 1 - return summable misc data c = 2 - return nodal forces c = 3 - return nodal comp stresses c = 4 - return volume and energies c = 5 - return nodal gradients c = 6 - return elas strains c = 7 - return plast strains c = 8 - return creep strains c = 9 - return thermal strains c = 10 - return euler angles c = 11 - return nodal fluxes c = 12 - return local forces c = 13 - return non-summable misc data c = 14 - return elem current density c = 15 - return nonlinear data c = 16 - return calc heat generations c = 17 - return elem temp's c elem (int,sc,in) - elem no. c ivect (int(ar(*),inout) - working array for reading indices c iwork (int,ar(*),inout) - work array for paging when reading file c c output arguments: c variable (typ,siz,intent) description c rlnget (int,func,out) - status of read c =-1 - error on read c = 0 - no info found c > 0 - number of items returned c darry (int,ar(10),out) -
/PREP7*
Main Menu>Preprocessor*
ET*
MP*
Defines a table of material properties Defines nonlinear material data, some element data, or both Defines element real constants
TB
LOCAL
Utility Menu>WorkPlane>Local Coordinates>Create Local Defines a local coordinate CS>At Specified Loc system Main Menu>Preprocessor>Create> Nodes>In Active CS or On Working Plane
N*
E or EN*
Defines an element. (You must set the correct TYPE, MAT, REAL, and ESYS pointers before defining the element.) Defines the analysis type. See the ANSYS Commands Reference for details. Defines master degrees of freedom Defines the acceleration vector Defines degree of freedom constraints
ACEL
Main Menu>Preprocessor>-Loads->Apply>Gravity
D*
SF or SFE
Main Menu>Preprocessor>-Loads_ >Apply>surface load type>On entity Main Menu>Preprocessor>-Loads>Apply>load type>On entity
BF or BFE
If you place the command /NOPRINT at the beginning of the file and /GOPRINT 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 /NOPRINT command, /COM provides status information about what is being read in. For example:
Group elements with the same attributes (TYPE, REAL, MAT, ESYS). Don't 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.
data in terms of ANSYS input commands. (For a complete list of data in the file, see the CDWRITE description in the ANSYS Commands Reference.) You can convert this information to a format compatible with the program into which you're 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, 1),
1 2 3 4 5 6 7 8 9 10 11 12 19 20 21 22 23 24
FX FY FZ MX MY MZ CSGX CSGY CSGZ VFX VFY VFZ FLOW HEAT AMPS FLUX NPKE NPDS
25 26
EMF CURR
CURT VLTG
3.3.1 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 Type STLOC The real constant set reference number The type of data to be defined. LOC is the valid label. 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
Type
NCSY CSYTYP
The coordinate system reference number The coordinate system type (0, 1, 2, or 3) Values to be read
VAL1,VAL2,VAL3
G G
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.
Solkey
Format
Field 1 - Node. Field 2 - The solid model entity (if any) in which the node exists. Field 3 - The line location (if the node exists on a line). Fields 4-6 - The nodal coordinates. Fields 7-9 - The rotation angles.
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
3.3.4 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 The type of data to be defined. Valid labels are LOC (read in system origin) and ANG (read in rotation angles). The node number The solid model reference key Line parameter value (0 if not on line) Values to be read VAL1,VAL2,VAL3
G
Type
If Type is LOC, values are the system origin in global Cartesian coordinates. If Type is ANG, values are the rotation angles in degrees.
Solkey
The solid model key. The element is part of a solid model if the keyword SOLID appears here. Data descriptors defining the format. For the EBLOCK command, this is always (19i7).
Format
G G G G G G G G
Field 1 - The material number. Field 2 - The element type number. Field 3 - The real constant number. Field 4 - The section ID attribute (beam section) number. See elements BEAM188 and BEAM189 for more information. Field 5 - The element coordinate system number. Field 6 - The birth/death flag. Field 7- The solid model reference number. Field 8 - The element shape flag. Field 9 - 0 Field 10 - The exclude key (p-elements). Field 11 - The element number. Field 12-19 - The node numbers. The next line will have the additional node numbers if there are more than eight.
3.3.6 EN Command
If the UNBLOCKED option is used with the CDWRITE command, then the EN command is used to define an element. This is also the method used for defining elements in .CDB files before ANSYS 5.4. 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.1,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). The number of nodes
Type
NUMN
If Type is ATTR, the values are the element attributes. Attributes are in the order: NUMN,MAT,TYPE,REAL,NUMELEMENT,ESYS, Solid_Ref,Birth/Death,Pexclude If Type is NODE, the values are the node numbers.
TEMP1, TEMP2, Temperatures assigned to three locations in the table starting at STLOC TEMP3
Lab
MAT
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
3.3.9 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 NCP Dlab The total number of nodes in the coupled set The coupled node reference number The degree of freedom label for the set
N1,N2,N3, N4,N5, N6,N7 The next seven node numbers in the coupled set
3.3.10 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 CONST The constraint equation reference number 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. The alternate format for the CE command is: CE,R5.0,Type,N1,Dlab1,C1,N2,Dlab2,C2 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 N2 The coefficient of N1 The node number of the next term
3.3.11 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
ELEM The element number LKEY The load key associated with this surface load A label indicating the type of surface load: Valid labels are:
G G
Lab
G G G G G
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's 1, the values are real (film coefficient if convection). If it's 2, values are imaginary (bulk temperature if convection).
DIOFFST Offset distance from node I DJOFFST Offset distance from node J
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, Tektronix'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't verify the use of the PLOT33 program with all plotter types.
G
A description of the format for the ANSYS neutral graphics file. This listing excludes format information for zbuffered graphics, but the PLOT33 program does include a section on z-buffered graphics.
Numerals 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 Uppercase alphabetic characters A through Z The following characters: $ ( ) * + , - . < = > The space character, " ".
(BBAAA
The Start-Plot directive, beginning with command character. (B, B, A, A, and A are the values of parameters defining the plot environment. (Parameters for all plot directives, and their possible values, are explained later.) The Text-Size directive, which determines the type size of displayed text strings. The 2 is the command character, and A represents the size value. The Window directive, which sets the coordinates for the displayed image. 0 is the command character. AAAAAA represents the first set of coordinates (the lower left corner of the image), and PPPLPO represents the second coordinate set (the right upper corner of the image). The Text-Color directive, which sets the color of displayed text. > is the command character. AP is a parameter value specifying the color. The first of several Text directives. $ is the command character, MEKLKB are the coordinates for the text, AJ is the number of characters in the string, and ANSYS 5.3 is the text string itself.
2A
0AAAAAAPPPLPO
>AP
$MEKLKBAJANSYS 5.3
$MEKLEFALNOV 15 1996 A second Text directive, defining the position and length of the string NOV 15 1996. $MEKKOJAI10:01:40 A third Text directive, defining the position and length of the string 10:01:40
1 byte, base 16 (letters A through P) 0 through 15 2 bytes, base 16 (letters A through P) 0 through 255 3 bytes, base 16 (letters A through P) 0 through 65535 6 bytes, base 16 (letters A through P) 0 through 4095, mapped to coordinate space of -1.0 to 1.67 An array of Nchar characters Characters from the common character set.
Graphics Directive Command Character Parameters keras - Defines whether the display surface is cleared prior to the plot (0 = don't clear the surface, 1 = clear it) kras - Defines whether the display uses raster mode or vector mode (1 = raster mode, 0 = vector mode) Start_Plot ( kcntr - Defines whether the display uses a contour color map or shading color map (1 = contour, 0 = shading) kdocu - Defines whether the Docu column is compressed (1 = don't compress, 0 = compress) ispare - A spare value Window 0 x1,y1, x2,y2 (x and y coordinates) iclra - Sets the color for the displayed area. (See "Color Specification" below.) iclrg - Sets the color for the displayed graph. (See "Color Specification" below.)
Parameter Types
Xy, Xy
Area-Color
<
Long
Graph-Color
Long
Text-Color
>
iclrt - Sets the color for displayed text. Long (See "Color Specification" below.) tsize - Defines the size of displayed text (0 = normal, 1 = small)
Text-Size
Int
Line-Type
ltype - Defines the type of lines used in Int the display (0 = solid, 1 = dashed) lwidth - Defines the width of displayed lines (0 = normal, 1 to 5 = larger line Int size) size - Defines the size of the node marker (0 = the smallest size, 15 = the largest size)
Line-Width
Marker Size
int
* . -
x,y - Defines a point at coordinates x,y Xy x,y - Moves to coordinates x,y x,y - Draws a line to coordinates x,y x,y - Sets coordinates for where text will display Xy Xy
Text
nchar - Defines the number of displayed characters string - Defines the text string itself inorm - This value, divided by 255, is cos(), where is the viewing direction and the surface normal of subsequent polygons n - Defines the number of polygon vertices kedge - Defines whether the polygon edge is displayed (0, = don't display edge, 1 = display it) xy1,xyn - Defines coordinates for the polygon
Normal
Long
Polygon
No-Op End-Plot
none )
no parameters no parameters kpx - Defines the pixel resolution x1,y1 - Sets coordinates for the lower left corner of the z-buffer image x2,y2 - Sets coordinates for the upper right corner of the z-buffer image
none none
Pixmap
The following three parameters are runlength encoded data which repeats until Byt3, Xy, Xy, Long, Long, all pixels are read in, as defined by the Long, window (X2-X1 + 1) * (Y2-Y1 + 1) n - Defines the number of pixels in a row
inrm - Sets the normal for pixels iclr - Sets the color for the pixmap
16 : 127 Blue : Cyan : Green 128 : : 255 : Indices 128 through 255 represent the color spectrum used to display the Low (Blue) to High (Red) contour values. : Yellow : Orange : Red Reserved for future use
The ANSYS command stream used to create a simple graphics plot, shown in Figure 4-2 below The encoded graphics file that these commands produce The decoded graphics plot directives
(BBAAA2A0AAAAAAPPPLPO<AA>AP$MEKLKBAJANSYS 5.3$MEKLEFALNOV 16 1996$MEK KOJAI15:57:07$MEKKIMAMPLOT NO. 1$MEKKDAAIELEMENTS$MEKJNEAIELEM NUM2 B0AAAAAALPOLPO<AB/PP+EBBBHBBHKOGBBHKOGKOGBBHKOG$FPPFPPAB1$AILAILAB1$L HCAILAB2$LHCLHCAB4$AILLHCAB32A0AAAAAAPPPLPO.AAAAAA-LPOAAA-LPOLPO-AAAL PO-AAAAAA>AB$ABLLKBAB1>AP$MEKJBLAGZV =1$MEKILPAJDIST=0.55$MEKIGCAIXF =1.5$MEKIAGAIYF =0.5$MEKHKKAPCENTROID HIDDEN$ABOABOCA ANSYS 5.3 Ex ample Graphics File)
(BBAAA 2A 0AAAAAAPPPLPO <AA >AP $MEKLKBAJANSYS 5.3 $MEKLEFALNOV 16 1996 $MEKKOJAI15:57:07 $MEKKIMAMPLOT NO. $MEKKDAAIELEMENTS $MEKJNEAIELEM NUM 2B 0AAAAAALPOLPO <AB /PP 1
Start-Plot: /ERASE, raster mode Text-Size: Default Window: 0.0 4095,3070 Area-Color: Black Text-Color: White Text: 3146 2977 "ANSYS 5.3" Text: 3146 2885 "NOV 15 1996" Text: 3146 2793 "15:57:07" Text: 3146 2700 "PLOT NO. 1" Text: 3146 2608 "ELEMENTS" Text: 3146 2516 "ELEM NUM" Text-Size: Small Window: 0 0 3070 3070 Area-Color: Cyan Normal: 255 Polygon: 279, 279, 2790, 279
+EBBBHBBHKOGBBHKOGKOGBBHKOG 2790,2790 279, 2790 $FPPFPPAB1 $AILAILAB1 $LHCAILAB2 $LHCLHCAB4 $AILLHCAB3 Text: 1535 1535 "1" Text: 139 139 "1" Text: 2930 139 "2" Text: 2930 2930 "4" Text: 139 2930 "3"
2A 0AAAAAAPPPLPO .AAAAAA -LPOAAA -LPOLPO -AAALPO -AAAAAA >AB $ABLLKBAB1 >AP $MEKJBLAGZV =1
Text-Size: Default Window: 0,0 4095,3070 Move: 0,0 Draw: 3070,0 Draw: 3070,3070 Draw: 0,3070 Draw: 0,0 Text-Color: Cyan Text: 27 2977 "1" Text Color: White Text: 3146 2331 "ZV =1" Text: 3146 2239 "DIST=0.55" Text: 3146 2146 "XF =1.5" Text: 3146 2054 "YF =0.5" Text: 3146 1962 "CENTROID HIDDEN"
$MEKHKKAPCENTROID HIDDEN
$ABOABOCA ANSYS 5.3 Example Text: 30 30 "ANSYS 5.3 Example Graphics File" Graphics File ) End-Plot No-Op
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c c the plot33 program is provided in source format to allow users to c c make any modifications necessary for a particular system. c c c c this standard version may be linked with user-supplied calcomp c c hcbs software (plot, plots, symbol), or other software that uses c c the calcomp subroutine protocol, e.g., hewlett-packard ispp, c c tektronix preview, veratec versaplot, etc. c c c c to work with other plotter software it may be necessary for the c c user to remove the calcomp subroutine calls (plots, plot, and c c symbol) and substitute the subroutine calls appropriate for the c c software being used. c c c c because of the large variety of different plotters used by ansys c c customers, it is not possible for sasi to verify the use of this c c plot33 program with all plotter types. c c c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c #include "impcom.inc" c external plots,plot,symbol,pl33in,pl33xy,pack integer oufile,i,ibufpl(1),iout,numplt,ipl(80),kerase,krastr, x iclra,iclrg,iclrt,iltyp,inorm,nchar,nvert,kedge,kytsiz real chsize,xp1,x1p2,ysz,xzero,xmin,ymin,xmax,ymax,x,y,xy(2,8) character*80 strng integer infile,inbuf,ibf,ix1,iy1,ix2,iy2,kpx,npix,ntot, x n,iclr,inrm real xsize,ysize common /pl33cm/ xsize,ysize,infile,inbuf,ibf(80) data xzero,xp1,x1p2 /0.0, 0.1, 1.2/ c c ********** set the file number ********** infile = 33 oufile = 77 c ********** define the output file ********** iout = 6 c ********** open the file ********** open (unit=infile,file='FILE33.DAT',status='OLD',iostat=i) if (i .ne. 0) then write (iout,1111) 1111 format (' *** ERROR *** FILE33.DAT DOES NOT EXIST.') go to 999 end if c ********** begin session ********** write (iout,2000) infile 2000 format (/,' ***** BEGIN PLOT33 FROM FILE',i2,' *****') c ********** initialize the plotting device ********** call plots (ibufpl(1),1,oufile) inbuf = 80 xsize = 10.0 ysize = 10.0
numplt = 0 chsize = xp1 c c ********** loop through all the plotting commands 10 continue call pl33in (1,ipl(1)) if (ipl(1) .eq. 0) then ********** end-of-file ********** call plot (xzero,xzero,999) go to 900 else if (ipl(1) .eq. 40) then ********** start plotting ********** call pl33in (5,ipl(1)) kerase = ipl(1) - 65 krastr = ipl(2) - 65 if ((numplt .ge. 1) .and. (kerase .eq. 1)) then ********** advance paper ********** ysz = x1p2 * xsize call plot (ysz,xzero,-3) end if if (kerase .eq. 1) numplt = numplt + 1 else if (ipl(1) .eq. 41) then ********** end plotting ********** inbuf = 80 else if (ipl(1) .eq. 48) then ********** window ********** call pl33in (6,ipl(1)) call pl33xy (ipl(1),xmin,ymin) call pl33in (6,ipl(1)) call pl33xy (ipl(1),xmax,ymax) else if (ipl(1) .eq. 60) then ********** area color ********** call pl33in (2,ipl(1)) iclra = 16 * (ipl(1)-65) + ipl(2) - 65 else if (ipl(1) .eq. 61) then ********** graph color ********** call pl33in (2,ipl(1)) iclrg = 16 * (ipl(1)-65) + ipl(2) - 65 else if (ipl(1) .eq. 62) then ********** text color ********** call pl33in (2,ipl(1)) iclrt = 16 * (ipl(1)-65) + ipl(2) - 65 else if (ipl(1) .eq. 44) then ********** line type ********** call pl33in (1,ipl(1)) iltyp = ipl(1) - 65 else if (ipl(1) .eq. 49) then ********** line width ********** call pl33in (1,ipl(1)) iltyp = ipl(1) - 65 else if (ipl(1) .eq. 51) then ********** marker size ********** call pl33in (1,ipl(1)) iltyp = ipl(1) - 65 **********
else if (ipl(1) .eq. 47) then ********** normal ********** call pl33in (2,ipl(1)) inorm = 16 * (ipl(1)-65) + ipl(2) - 65 else if (ipl(1) .eq. 42) then ********** dot ********** call pl33in (6,ipl(1)) call pl33xy (ipl(1),x,y) call plot (x,y,3) call plot (x,y,2) else if (ipl(1) .eq. 46) then ********** move ********** call pl33in (6,ipl(1)) call pl33xy (ipl(1),x,y) call plot (x,y,3) else if (ipl(1) .eq. 45) then ********** draw ********** call pl33in (6,ipl(1)) call pl33xy (ipl(1),x,y) call plot (x,y,2) else if (ipl(1) .eq. 36) then ********** text ********** call pl33in (6,ipl(1)) call pl33xy (ipl(1),x,y) call pl33in (2,ipl(1)) nchar = 16 * (ipl(1)-65) + ipl(2) - 65 call pl33in (nchar,ipl(1)) call pack (ipl(1),strng,nchar) call symbol (x,y,chsize,strng,xzero,nchar) else if (ipl(1) .eq. 43) then ********** area ********** call pl33in (2,ipl(1)) nvert = ipl(1) - 65 kedge = ipl(2) - 65 do 20 i = 1,nvert call pl33in (6,ipl(1)) call pl33xy (ipl(1),xy(1,i),xy(2,i)) 20 continue elseif (ipl(1) .eq. 50) then ********** set text size key ********** call pl33in (1,ipl(1)) kytsiz = ipl(1) - 65 elseif (ipl(1) .eq. 90) then ********** pixmap [z] ********** call pl33in (15, ipl(1)) kpx = 256*(ipl(1) -65) + 16*(ipl(2) -65) + ix1 = 256*(ipl(4) -65) + 16*(ipl(5) -65) + iy1 = 256*(ipl(7) -65) + 16*(ipl(8) -65) + ix2 = 256*(ipl(10)-65) + 16*(ipl(11)-65) + iy2 = 256*(ipl(13)-65) + 16*(ipl(14)-65) + npix = (ix2-ix1+1)*(iy2-iy1+1) ntot = 0 300 call pl33in (6, ipl(1)) n = 16*(ipl(1)-65) + ipl(2) - 65
c c
inrm = 16*(ipl(3)-65) + ipl(4) - 65 iclr = 16*(ipl(5)-65) + ipl(6) - 65 ntot = ntot + n if (ntot .lt. npix) go to 300 else if (ipl(1) .eq. 32) then ********** no-op ********** else ********** unknown ********** end if go to 10
c c
******** close input file ******** 900 close (unit=infile) write (iout,2001) 2001 format (/,' ***** END OF PLOT33 *****') 999 stop end subroutine pl33in (n,ib) c ********** read in "n" characters and unpack them ********** c ********** into the ascii integer array, "ib(*)". ********** c *** Notice - This file contains ANSYS Confidential information *** external unpack integer n,ib(*),nn,ii,j,k,i character*80 inline integer infile,inbuf,ibf real xsize,ysize common /pl33cm/ xsize,ysize,infile,inbuf,ibf(80) c nn = n ii = 0 10 continue if (inbuf .eq. 80) then read (infile,1000,end=900) inline 1000 FORMAT (A80) call unpack (inline,ibf(1),80) inbuf = 0 end if k = inbuf + nn if (k .le. 80) then do 21 i = 1,nn ib(ii+i) = ibf(inbuf+i) 21 continue inbuf = k else j = 80 - inbuf do 30 i = 1,j ib(ii+i) = ibf(inbuf+i) 30 continue inbuf = 80 nn = nn - j ii = ii + j go to 10 end if go to 999
900 continue ib(1) = 0 inbuf = 80 c 999 return end subroutine pl33xy (ipl,x,y) c ********** get the x,y location of a point ********** c *** Notice - This file contains ANSYS Confidential information *** integer ipl(6) real x,y,x3070 integer infile,inbuf,ibf real xsize,ysize common /pl33cm/ xsize,ysize,infile,inbuf,ibf(80) data x3070 /3070.0/ c x = 256 * (ipl(1)-65) + 16 * (ipl(2)-65) + ipl(3) - 65 x = x * xsize / x3070 y = 256 * (ipl(4)-65) + 16 * (ipl(5)-65) + ipl(6) - 65 y = y * ysize / x3070 c return end subroutine pack(invar,outvar,n) c *** Notice - This file contains ANSYS Confidential information *** c c --- pack ascii data into character data c #include "impcom.inc" c integer invar(*),i,n character*1 outvar(*) c do 10 i = 1, n c must add 128 for prime parity bit outvar(i) = char(invar(i)) 10 continue return end subroutine unpack(invar,outvar,n) c *** Notice - This file contains ANSYS Confidential information *** c c --- unpack character data into ascii data c #include "impcom.inc" c integer outvar(*),i,n character*1 invar(*) c do 10 i = 1, n c must subtract 128 for prime parity bit outvar(i) = ichar(invar(i)) 10 continue return
system
system
end
1 What is UIDL?
1.1 What Is the ANSYS UIDL? 1.2 The Structure of UIDL 1.2.1 Control Files 1.2.1.1 Control File Header 1.2.2 Building Blocks 1.2.2.1 Menu Blocks 1.2.2.2 Function Blocks 1.2.2.3 Help Blocks 1.3 Overview of Building Blocks 1.3.1 The Header Section 1.3.2 The Data Controls Section 1.3.3 Ending Line
1.4 General Guidelines for Control Files 1.5 The menulist54.ans File
5 Advanced Topics
5.1 Using ANSYS Parameters for Data Flow 5.2 Suppressing ANSYS Commands 5.2.1 General Guidelines for Command Suppression 5.2.2 Examples of Command Suppression
S T U X
D.1.2 Debugging and Keywords D.1.3 Verifying a Building Block D.2 Troubleshooting D.2.1 Troubleshooting Dialogs
COMMAND
path/filename.ext
ARGUMENT
Argument
command,arg1,arg2
Note-
Information that supplements the main topic being discussed, such as important tips or guidelines. Actions or situations that could cause problems, unexpected ANSYS behavior, or unexpected results. Actions or situations that can shut down ANSYS, damage files, cause loss of data, etc.
Caution:
Warning:
This guide describes a group of utilities as well as a set Fortran 77 routines that you can use to directly access the ANSYS database. You can also use these capabilities to access data in any of the binary files that ANSYS writes or uses. The entire set of programmer's guides can be accessed online as HTML files or downloaded (in either HTML or Postscript format) through the ANSYS documentation web site, http://www.ansys.com/Documentation/Manuals/872. A list containing the complete set of available ANSYS documentation is available at http://www.ansys.com/ServSupp/Library/library.html
Items on the ANSYS Main Menu Dialogs, including picking dialogs Online help
Customizing the GUI lets you modify many ANSYS menus and dialogs and integrate locallydeveloped programs into the ANSYS environment.
menu blocks, for creating menus function blocks, for creating dialogs help blocks, for displaying online help
The UIDL processor reads the control file, inserts ANSYS indexing information (which relates the building blocks to the ANSYS GUI) into the control file, and builds the GUI. To customize the ANSYS GUI with UIDL, perform the following steps: 1. Create at least one new control file and save it to a subdirectory.
2. Copy the control file to the directory where your copy of the menulist55.ans file resides. 3. Add the name of the new local control file to the menulist55.ans file. 4. Run ANSYS to see if the changes you made appear in the GUI. 5. Make any changes to the original in the subdirectory and copy it to the same directory as you did in Step 2.
UIOTHR.HLP UIOTHR.HPS Other Help Help files contain online help in multiple formats. See Chapter 4 for more information. Note-Never modify these files! Modifying the standard ANSYS control files will make the ANSYS GUI fail. Since the standard help control files are quite large and require special treatment, do not copy them. See Chapter 4 for complete information on how to build online help.
:D String
:I 0, 0, 0
:!
For more information on the commands, see Appendix A, "UIDL Command Dictionary." When UIDL processes an edited control file, the 0s and commas are replaced with indexing information. If you modify an indexed control file, you must reinsert the :I command with the 0s and commas in their proper places.
Note-Keep a clean copy of every control file in a subdirectory. Consider creating a one-line file that consists of :I and the 0s and commas in their correct locations. Whenever you create a new control file, you can insert the one-line file and ensure that the location of the 0s (zeros) is always correct. Once you start ANSYS after having created new control files, ANSYS adds additional information to the end of the control file. ANSYS inserts :X INDEX ADDED BY ANSYS at the end of each control file. The name of each block appears, followed by an index number. If you ever modify an indexed control file, you must delete everything after the final :E END command of the control file.
Layout and content of the configurable dialogs and prompts Picking operations Hidden operations which build and pass commands from the GUI to ANSYS
The standard ANSYS dialogs are stored in the UIFUNC1.GRN and the UIFUNC2.GRN files. Function blocks are discussed in detail in Chapter 3, "Modifying Function Blocks."
Each type of building block has different data controls. Each control file typically contains multiple building blocks. Figure 1-1 shows a sample control file containing a menu block for an ANSYS GUI menu. This menu block builds the ANSYS Main Menu. The arrows relate portions of the code to some of the options on the menu. Figure 1-1 A Control File Containing the ANSYS Main Menu Building Block
Note-Menu names are prefixed by the Men_ string. The only exception to this is the MenuRoot menu depicted above.
All header commands begin with a colon (:). Each header section must begin with a :N command which defines the unique, internal name of the building block. The next command, :S, is a space holder for the index line. This command must have zeros, separated by commas, in columns 9, 16 and 23. Consider creating a one-line file that consists of :S and the 0s and commas in their correct locations. The :T indicates the type of building block: Menu, Cmd, or Help. Optional UIDL commands, such as :A (menu heading) and :D (block description), can also be in the header. The header section is processed as soon as the building block is entered by the UIDL processor.
file.
This example also shows the use of a simple APDL routine in the header section, which is used to determine the current ANSYS routine, and, if it is not in /POST26, it will enter the Time-History Postprocessor. See the APDL Programmer's Guide for more information. The :C UIDL command calls ANSYS commands, which include APDL routines, user-programmable functions and external libraries. The data controls section lists all commands which will appear on a menu. Note that on a menu, each reference to a submenu ends in a greater-than sign, and each reference to a dialog ends in ellipses.
:N Men_String
Required; defines the internal name of the menu block. Required; space holder for ANSYS indexing. The 0s (zeros) must be in columns 9, 16 and 23 and must be separated by commas. Required; defines the type of the block. To define a menu block the string Menu must appear after the :T command. Required; defines the title of the menu block as it appears on a submenu. When the current menu block is called by another menu block, it displays the title of the menu and appends a > to the string. Note-Items listed on a menu under a subhead should be indented by three spaces. Optional; describes the menu block. Optional; executes ANSYS commands, APDL, user-defined functions or external library calls when this menu block is entered. Optional; filters this menu block based on keywords. See Appendix A for a list of ANSYS keywords. Optional; filters this menu block based on product codes. See Appendix B for a list of product codes.
:S 0, 0, 0
:T Menu
:A String
:D String
:C Command String
:K Keyword Logic
Men_String
Fnc_String
Sep_
Inserts a separator line on the menu between commands. Inserts the text to be used as a menu title. Note-In the menu block header, the contents of the :A string should be indented by three spaces.
String
When building the data control section for a dialog, use at least one Typ_ data control and do not use
any Inp_P controls. Picking box A picking box lets the user select keypoints, lines, volumes, nodes (etc.) from a model. Here is a standard ANSYS picking box, which uses the ANSYS A command to create areas through selected keypoints, and requires that at least three keypoints be selected: Figure 3-2 Function Block for a Create Area thru KPs Picking Box
When building the data control section of a picking box, include the Inp_P data control and at least one Typ_ data control. Hidden A hidden function is performed without displaying a dialog or picking box. Figure 3-3 shows a sample hidden function block: Figure 3-3 Function Block for a Hidden Function :N :S :T :A :C :C :C :C :C Fnc_CirBD_3 0, 0, 0 Cmd Hidden (Change Element Color) )! Fnc_CirBD_3 )/nopr )*get,_z(30),graph,,number )/pnum,mat,1 )/num,1
:C )eplot :C )/num,_z(30) :C )/go :P (ELECMAG) Inp_P Cmd_)! :E END When building the data control section for a hidden function, include the Inp_P data control and at least one Cmd_ data control with no Typ_ data controls which require input from the user. To make it more readable include :A Hidden in the header section of the function block, and include some information about what the function block does.
:S 0, 0, 0
:T Cmd
:A String
:D String
:C Command
:K Keyword Logic
Optional; filters this function block based on keywords. See Appendix B for a complete list of keywords. Optional; filters this function block based on product codes. See Appendix C for a complete list of product codes. Optional; defines the internal name of the help block which documents the dialog. The procedure for naming and writing help blocks is documented in Chapter 4.
:H Hlp_String
Cal_REFRESH Forces a refresh of the lowest active side menu Fmt_H Inp_ P Inp_NoApply K _LN P_LN Forces a narrow dialog Defines picking boxes or hidden function blocks Suppresses the Apply button Sets keyword logic for the next line Sets product code logic for the next line
Switches FLST and FITEM on and off Forces a rebuild of a dialog after an Apply Defines a default value for a field which is not displayed Displays label without an associated button or entry field
K_FL Sets keyword logic for this field P_FL Sets product code logic for this field Prm_ Defines label or prompt to use with this field Picking Controls
Cnt_ Max_ Min_ Pcn_ Pdp_ Pfm_ Rub_ Sel_ Typ_Entity Typ_Resu Typ_XYZ
Sets maximum number of items, except an apply is not done Sets maximum number of items Sets minimum number of items Defines ordered or unordered set Permits duplicate entity picking Controls how picked items are processed Defines the type of rubber banding to use Defines type of selection allowed Gets the numbers of the specified entities Gets the results for a specified entities Gets the coordinates of a point
Typ_XYZ_SCREEN Gets the screen coordinates Typ_XYZ_WP Listing Controls Bnd_LOWER,UPPER Creates bounds for Typ_MLis Typ_Color Typ_Idx Typ_Lis_OptionB Creates an option button of available colors Creates side-by-side scrolling lists from the subsequent Idx_ controls Creates an option button list Gets the working plane coordinates of a point
Creates a radio button list Creates a single selection scrolling list Creates a multiple selection scrolling list Creates items in the list Defines a list of items from a database
Creates a file selection box with filter, directory and file names
Typ_File_Inline Creates a text entry field for passing a filename to ANSYS Numerical Controls Typ_Int Typ_Int2 Typ_Int3 Creates a single input field for integer data Creates two input fields for integer data Creates three input fields for integer data
Typ_Real Creates a single input field for real number data Typ_Real2 Creates two input fields for real number data Typ_Real3 Creates three input fields for real number data Character Controls Typ_Char Creates an input field for character data Logical Controls
Some of the UIDL commands behave differently in a dialog block than in a menu. The :D command, for example, is used to insert text into the title bar of the dialog. There are some additional header commands for function blocks, such as the :H command. The :H command is used to associate an online help file with the dialog's Help button. The Cal_Fnc_ command is used rather than the Cmd_ command since *VPUT is called with different arguments depending on the type of data the user selects. Here is a list of guidelines to help you write function blocks:
G G G
G G
G G G G
Any ANSYS command name must be all uppercase and enclosed in brackets. Use the same case for field names as in the ANSYS Commands Reference. Use the Typ_Sep control to vertically separate logical groups within a dialog (for example commands, options, etc.). Use "white" space as a horizontal separator, not characters (i.e. *, -, #, etc.). When a prompt is longer than one line, use a "-" dash at the end of the first line and at the beginning of the second line. Capitalize the title heading-style and be sure it describes the whole dialog. Avoid using a scroll bar in a dialog-limit the vertical height appropriately. Do not use picking inside a dialog. It does not exhibit clean behavior. Do not document the commands within the dialog. Keep field explanations brief. Use online help to document commands. See Chapter 4 for more information. Add a line containing the text :C )!Fnc_String to the header section of the function block. To write the name of the function block to the log file, type KEYW,QALOGKEY,1 into the ANSYS Input Window for debugging purposes. An error in a function block can cause lines to be deleted in the control file when the UIDL
G G
processor indexes it. For better readability, separate each function block with a :! line. You can use the K_ and P_ commands together, but you can use only one of each (with the exception of K_LN). If a dialog's contents will change after an Apply operation (for example, *READ for a list), place an Rmk_ control at the top of the function's data control section. A line in a control file cannot be more than 80 characters.
Fld_2 Prm_Apply this color to the areas: Typ_Color Fld_0 Typ_Sep Fld_0 Typ_Lab Prm_Use Typ_Lis for a single selection text list Fld_3 Typ_Lis Lis_Structural,1 Lis_Thermal,2
Lis_Magnetics,3 Lis_Electric,4 Lis_CFD,5 Prm_Chosen item appears in Selection Fld_0 Typ_Sep Fld_0 Typ_Lab Prm_Use Typ_Lis_OptionB for a text option button list Fld_4 Prm_DOF set to be used Typ_Lis_OptionB Lis_Structural,UX,UY,UZ Lis_Electric,AX,AY,AZ Fld_0 Typ_Sep Fld_0 Typ_Lab Prm_Use Typ_Lis_RadioB to create a radio-style button list Fld_5 Prm_Save the graphic as Typ_Lis_RadioB Lis_PostScript,ps Lis_Interleaf,il Lis_HPGL,gl :E End Figure 3-6 Function Block for Creating a Dialog with Multiple-Selection Lists
Fld_0 Typ_Sep Fld_0 Typ_Lab Prm_Use Typ_Idx for a side-by-side parent-child list Fld_0 Typ_Lab Prm_[*GET] Get Scalar Data Fld_2 Prm_Type of data to be retrieved Typ_Idx Idx_Current settings,Current settings,1 Idx_Graphics data ,Graphics data ,2 Idx_Model data ,Nodes ,3 Idx_Model data ,Elements ,4 Idx_Model data ,Keypoints ,5 Idx_Model data ,Lines ,6 Idx_Model data ,Areas ,7
,Volumes ,8 ,For selected set,9 ,Coord systems ,10 ,Element types ,11 ,Real constants ,12 ,Material props ,13 ,Data tables ,14 ,Global measures ,15 ,Nodal results ,16 ,Element results ,17 ,Modal results ,18 ,Elem table data ,19 ,Elem table sums ,20 ,Elem table misc ,21 ,Path operations ,22 ,Other operations,23 ,Time-hist var's ,24 ,Design opt data ,25 ,Parameters ,26 ,Run time stats ,27
Idx_Model data Idx_Results data Idx_Results data Idx_Results data Idx_Results data Idx_Results data Idx_Results data Idx_Results data Idx_Results data Idx_Results data Idx_Results data Idx_Design opt data Idx_Parameters Idx_Run time stats Fld_0 Typ_Sep Fld_0 Typ_Lab Prm_Use Inp_Noapply :E End
Figure 3-7 Function Block for Creating a Dialog with a File Selection Box
Figure 3-8 Function Block for Creating a Dialog with Data Entry Fields
Fld_0 Typ_Lab Prm_Use Typ_Real to create real valued input fields Fld_4 Typ_Real Prm_Typ_Real Fld_5
Typ_Real2 Prm_Typ_Real 2 Fld_6 Typ_Real3 Prm_Typ_Real3 Fld_0 Typ_Sep Fld_0 Typ_Lab Prm_Use Typ_Char to create a character input field Fld_7 Typ_Char Def_Default Prm_Jobname to be used Fld_0 Typ_Sep Fld_0 Typ_Lab Prm_Use Typ_Logi to create a logical toggle button Fld_8 Typ_Logi,Yes,No Prm_Do you want to exit :E End Figure 3-9 Function Block for Building a Picking Box for Creating Areas through Keypoints
the UIDL to create the layout and are usually invoked by issuing a variation of the ANSYS STAT command. The custom dialogs usually call other function blocks and/or ANSYS commands as a result of the user pressing a button in the custom dialog.
It is possible for there to be more than one ! Cust_ line for a custom dialog and since they are comments they may be placed anywhere in the data control section of the block.
Note that help blocks have an additional section-the help contents section. This section does not contain any commands; it contains the text or screen image that will appear online as the help. While
technically part of the data controls section, it is useful to view the help contents as a separate section. Note the numbers at the end of the header and data controls sections. The number in the data controls section is the number of bytes in the help contents section. The number in the header section is the number of BYTES in the help contents and data controls sections combined. Each time you modify the contents of a help contents section, you must update the byte counts in all locations. Listing the contents of a directory or using the wc -c command in Unix will give you the byte count for a specified file.
:S 0, 0, 0
Required; tells the UIDL that the data controls will be for a help block. BYTES represents the number of bytes in the data controls and help contents sections :T Help BYTES combined. This value must follow Help and must be updated each time the help contents section is modified. For PostScript and ZBitmap files, enter this line as :T Help, BYTES (a comma is required after Help).
Hlp_String for a user-created help block. Hlp_C_ANSYSCommandName for a command documented in the ANSYS Commands Reference (the internal name for the help block for AADD is Hlp_C_AADD). A user can enter Help, ANSYSCommandName in the ANSYS Input Window to display online help about the specified command. Hlp_E_S4.ELEMENTNUMBER for an element documented in the ANSYS Elements Reference (the internal name for the help block for LINK8 is Hlp_E_S4.8). A user can enter Help, ELEMENTNUMBER in the ANSYS Input Window to display online help about the specified element. Hlp_T_SSECTIONNUMBER for a section in the ANSYS Theory Reference (the internal name for help block for Section 12.5 is Hlp_T_S12.5). Hlp_G_GuideCHAPTERNUMBER for the Analysis Guides (the internal name for the help block for Chapter 10 of the ANSYS Modeling and Meshing Guide is Hlp_G_MOD10). Hlp_UI_Widget_Name for a screen in the ANSYS GUI Help Manual (the internal name for the
help block for the Pan Zoom Rotate control panel is Hlp_UI_Pan_Zoom). For the help block names for the chapters in the Analysis Guides, Guide is the first three letters of the document title. For instance, in the example shown above, "MOD10" specifies Chapter 10 of the ANSYS Modeling and Meshing Guide. When you are creating help block names for function blocks that you've written, be sure to give the help block a name similar to the function block to ease software maintenance.
Hlp_Previous_Block or Hps_Previous_Block
Hlp_Next_Block or Hps_Next_Block
Required; marks the end of the hyperlinks and the start of the help contents section. Note that even though hyperlinks can only be used END_OF_HYPERLINKS with ZBITMAP files, this line must always appear in the data controls section.
ASCII DATA_SIZE_IN_BYTES Example: ASCII 279 ZBITMAP COMPRESSED_DATA_SIZE_IN_BYTES DATA_SIZE_IN_BYTES Example: ZBITMAP 2798 223797 POSTSCRIPT COMPRESSED_DATA_SIZE_IN_BYTES DATA_SIZE_IN_BYTES Example: POSTSCRIPT 2798 223797
Note-PostScript files are not displayed as online help; they are included to allow the printing of help on Unix systems. The POSTSCRIPT data type is not used on Windows systems.
In this example, the string APDL: Process Controls, the Product groups, and the commands *ENDDO, *IF and *DO are all hyperlinks. Selecting any of these strings will display the online help
associated with those strings. The hyperlink command has the following format: Hyperlink_text PAGE#, X, Y, WIDTH, HEIGHT Help_block 0, 0, 0, 0
G G G G G G G G
Hyperlink_text is the anchor of the link on the page. PAGE# is the page number of the document starting at 0. X is the x pixel position from the top left corner of the page. Y is the y pixel position from the top left corner of the page. WIDTH is the width of the hyperlink box in pixels. HEIGHT is the height of the hyperlink box in pixels. Help_block is the name of the help block to display when the link is chosen. 0, 0, 0, 0 is a string of place-holding zeros that must end each hyperlink line.
Here are some sample hyperlink codes. In this example, the codes build the links for the online help for the ANSYS *EXIT command: APDL 0, 514, 126, 134, 12 Hlp_C_2.4e 0, 0, 0, 0 Mp 0, 110, 145, 304, 14, Hlp_UI_ProdCodes 0, 0, 0, 0 *ENDDO 0, 304, 207, 54, 12 Hlp_C_*ENDDO 0, 0, 0, 0 *IF 0, 227, 225, 19, 12 Hlp_C_*IF 0, 0, 0, 0 *DO 0, 132, 241, 28, 12 Hlp_C_*DO 0, 0, 0, 0
must also delete all the information following the last :E END command near the end of the control file. Note-Never modify the standard ANSYS help files found in the docu directory. Always build your own help control files using the process described in this section. UIDL supports storing online help content in two different ways:
G G
as text (ASCII data type) as compressed XWD format (ZBITMAP data type)
Additionally, online help files on Unix systems must be stored as as PostScript files for printing. Before you can associate individual help files with parts of ANSYS, you first must create the help in individual files and store them as text, compressed PostScript, or compressed XWD files. You must also understand how to point to commands, elements and portions of various manuals to add your own online help to the system. To get the required byte counts, create each help contents block in its own file and use a directory listing or the Unix wc -c command to get a byte count of each help contents section. Then, combine the help contents section with the other sections to create a whole help block. A control file which holds the help blocks must not be indexed when the control file is being edited. If the control file is indexed, either remove the indexing or use a clean, unindexed copy. Therefore, when creating a new control file or editing an existing one, always keep a clean backup copy that you can revert to. An error in a building block can cause lines to be deleted in the control file when the UIDL processor indexes it. As described earlier, it is useful to think of each help block consisting of four independent sections:
G G G G
header section data controls section help contents section ending section
When building a help block, each section should be in its own file. The following examples show three different kinds of help blocks. Each block is included in its own help control file. The first example consists of the code used to display a help screen when the Help>Table of Contents>Other command is chosen. All the file names include the string other. For consistency, we recommend naming the header section head_other, the data controls section hlp_other1 and the help contents section hlp_other2.
In the second and third examples, all the filenames contain the string exitst since they provide online help for the *EXIT command. Using a standard naming convention will help you maintain the help sections. Note-If you are using a text editor that does not include a linefeed as the last line, then you must press the ENTER key to include a linefeed as the last line of each file. The vi editor includes end-of-file linefeeds automatically.
window title are included but do not have any internal help block names attached. 4. Join hlp_other1 and hlp_other2 together into a new file (hlp_other). Unix users can use the concatentation command: cat hlp_other1 hlp_other2 > hlp_other Windows users can use the DOS copy command: copy hlp_other1 + hlp_other2 hlp_other 5. Determine the byte count of hlp_other. The byte count may be determined by displaying a directory listing and checking the byte column or, in Unix, by using the wc command: wc -c hlp_other The following information is displayed: 218 hlp_other This byte count is the number displayed before the file name. Record this number. In Step 6, you will insert this value after the string :T HELP. 6. Create a text file (head_other) containing the header section. :N Hlp_O_Contents :S 0, 0, :T HELP 218
7. Create a text file (end) containing the ending section. :E End 8. Create a text file (control_other) containing the control file header: :F OTHER.HLP :D Modified on 1/17 :I 0, 0, :!
9. Join these four files into a control file (OTHER.HLP) and save this file to your current working directory. Unix users can use the concatentation command: cat control_other head_other hlp_other end > OTHER.HLP
Windows users can use the DOS copy command: copy control_other + head_other + hlp_other + end OTHER.HLP 10. Add the file name OTHER.HLP to the end of the menulist55.ans file and start ANSYS to view the new online help.
APDL 0, 514, 126, 134, 12 Hlp_C_2.4e 0, 0, 0, 0 Mp 0, 110, 145, 304, 14, Hlp_UI_ProdCodes 0, 0, 0, 0 *ENDDO 0, 304, 207, 54, 12 Hlp_C_*ENDDO 0, 0, 0, 0 *IF 0, 227, 225, 19, 12 Hlp_C_*IF 0, 0, 0, 0 *DO 0, 132, 241, 28, 12 Hlp_C_*DO 0, 0, 0, 0 END_OF_HYPERLINKS
In this example, the two Hlp_lines following the help window title have the block names for the command description preceding the *EXITcommand and for the command description following. The lines following the data type line (ZBITMAP...) may be omitted if there are no hyperlinks on the page. 6. Join hlp_exitst1 and hlp_exitst2.Z together into a file (hlp_exitst). Unix users can use the concatentation command: cat hlp_exitst1 hlp_exitst2.Z > hlp_exitst Windows users can use the DOS copy command: copy hlp_exitst1 + hlp_exitst2.Z hlp_exitst 7. Determine the byte count of hlp_exitst. The byte count may be determined by displaying a directory listing and checking the byte column or, in Unix, by using the wc command: wc -c hlp_exitst The following information is displayed: 6182 hlp_exitst This byte count is the number displayed before the file name. Record this number. In Step 8, you will insert this value after the string :T HELP. 8. Create a text file (head_exitst) containing the header section: :N Hlp_C_*EXIT :S 0, 0, :T HELP,6182
10. Create a text file (control_exitst) containing the control file header: :F EXITST.HLP :D Modified on 1/17 :I 0, 0, :!
11. Join these four files into a control file (EXITST.HLP) and save this file to your current working directory. Unix users can use the concatentation command: cat control_exitst head_exitst hlp_exitst end > EXITST.HLP WIndows users can use the DOS copy command: copy control_exitst + head_exitst + hlp_exitst + end EXTIST.HLP 12. Add the file name EXITST.HLP to the end of the menulist55.ans file and start ANSYS to view the new online help. Note-Do not examine the XWD files in a text editor.
This byte count is the number displayed before the file name. Record this number. In Step 5, this is the second number inserted after the string POSTSCRIPT. 3. Compress the PostScript file using the Unix compress command to save the file in Adaptive Lempel-Ziv Coding format. compress ps_other2 4. Determine the byte count of the compressed file, ps_exitst2.Z The byte count may be determined by displaying a directory listing and checking the size column or, in Unix, by using the wc command. Record this number. In Step 5, this is the first number inserted after the string POSTSCRIPT. 5. Create a text file (ps_exitst1) containing the data controls section. Commands 3.E *EXIT Hps_EWRITE Hps_/EXIT POSTSCRIPT 14407 26504 END_OF_HYPERLINKS
In this example, the two Hps_lines following the help title have the block names for the command description before *EXIT command and for the one after. 6. Join ps_exitst1 and ps_exitst2.Z together into a file (ps_exitst). Unix users can use the concatentation command: cat ps_exitst1 ps_exitst2.Z > ps_exitst Windows users can use the DOS copy command: copy ps_exitst1 + ps_exitst2.Z ps_exitst 7. Determine the byte count of ps_exitst. The byte count may be determined by displaying a directory listing and checking the byte column or, in Unix, by using the wc command: wc -c ps_exitst The following information is displayed: 7327 ps_exitst This byte count is the number displayed before the file name. Record this number. In Step 8,
you will insert this value after the string :T HELP. 8. Create a text file (headps_exitst) containing the header section. :N Hps_C_*EXIT :S 0, 0, :T HELP,7327
9. Create a text file (end) containing the ending section. :E End 10. Create a text file (controlps_exitst) containing the control file header: :F EXITST.HPS :D Modified on 1/17 :I 0, 0, :!
11. Join these four files into a control file (EXITST.HPS) and save this file to your current working directory. Unix users can use the concatentation command: cat controlps_exitst headps_exitst ps_exitst end > EXITST.HPS Windows users can use the DOS copy command: copy controlps_exitst + headps_exitst ps_exitst end > EXITST.HPS 12. Add the file name EXITST.HPS to the end of the menulist55.ans file and start ANSYS to view the new online help. Note-Do not examine the PostScript files in a text editor. For information about some tools that can help automate the help-building process, see Appendix E, "Additional Help Tools."
You can use these parameters over and over again. Therefore, you can't count on parameter values being preserved outside the function blocks in which they're defined and used, because other function blocks will be using the same parameter names. When you use a scalar parameter, initialize it to prevent incorrect values. When using array parameters, you must delete and then dimension the array parameter at the beginning of the function block. For example: :C *DEL,_z(1)
:C *DIM,_z,,5,2 The *DEL command silently deletes parameters that begin with underscore (_), whether or not they exist or have been previously dimensioned. You can also use the GUI command *CSET to pass a 32-character string. See ANSYS Commands Reference for more information. To see the current status of hidden parameters, use the command *STAT,_prm. It will list all of the "_" parameters in use and their values.
The suppressed command is not likely to be used as an abbreviation or macro name. The suppressed command is not required when the log file is run in batch. That is, the output from the batch run of the log file should not be different from that of an interactive run. The suppressed command does not affect any subsequent ANSYS commands that do not use the ) option, and the result of the ) command does not affect any commands issued after it. The result of the suppressed command nullifies only the effect of a previous ANSYS command that did use the ) option.
The *GET commands and other APDL commands that begin with an * (asterisk) used in preparing defaults for function data fields qualify for using this option. Don't suppress xPLOT, xLIST, etc. commands even though these commands aren't absolutely required for a batch run. You can suppress module name commands (NODE, ELEM, MESH, etc.), and a following STATUS command. Commands on the same line (using $) should individually use this option if they need to be
suppressed. For example, in :C )*GET,_z1,... $*DEL,_z1, the *DEL command will be written to the log file. To suppress both commands, use: H :C )*GET,_z1.... $)*DEL,_z1 Although ")" commands aren't written to the command log, their action is echoed to the primary output when they execute. To avoid this output, enclose the suppressed commands with /NOPR and /GO as follows: Suppress command echo Following commands to be suppressed
:C :C :C :C :C :C
The following function block, PlaceBeam, uses a picking box to store the picked keypoints, then calls PlaceBeam2 to create a beam. PlaceBeam uses locational picking, and the FLST and FITEM commands store the picked coordinates. PlaceBeam2 uses the *FPIK control to get the location for each field.
Symbols
:! String Indicates a comment line or block separator. Header String A string containing 1 to 76 characters. Notes Comment lines are recommended for separating building blocks. Insert a :!command at the beginning of each new block header. Avoid using a :!on a line by itself-insert a blank space after the :!to create a block separator without a comment.
! String
Indicates a comment line. Data Control String A string containing 1 to 76 characters. Notes Avoid using a !on a line by itself-insert a blank space after the !.
A
:A String Defines the string to display on the menu calling this building block. (Required) Menu Header, Function Header String A 1- to 16-character string which names the menu. If this is a menu building block, a greaterthan symbol >will be appended to the string in column 18. Notes The name of this building block can match the name of other building blocks. This string is not the same as the internal name defined by the :Ncommand. The string defined by the :Ncommand is the internal name of the menu; it is only used for programming and is not displayed to the user.
ALIAS Calls the next help block automatically. Help Data Control
Explanation This control is used to call the next help block automatically. It must follow a pair of Hlp_Help_Block controls in the help data controls section.
B
Bnd_LOWER,UPPER Provides an upper and lower limit for the Typ_MLis control. Function Data Control LOWER,UPPER A lower and upper limit for the multiple list. Both limit values must be double precision numbers.
C
:C Command Specifies a command to be executed upon entry to a building block. Header Command Any valid 1- to-76-character command string. The string can consist of a standard ANSYS command, a line of APDL code, a user-programmable feature or a call to an external libraries. See the APDL Programmer's Guidefor more information on APDL. Notes You can specify multiple :Clines inside a building block, but they must be in the Header section of the block and they should be listed together.
Cal_Fnc_Block,FIELD,Oper,VALUE,CMDNUM Calls another function block, based on an if-test for a specified field. Function Data Control Fnc_Block The internal name of the function block to be called (as defined by a :Ncommand) if the if-test is satisfied. FIELD The number of the field to be evaluated. Oper The comparison operation to use for the evaluation. Valid operations are: EQ, NE, LT, GT, LE, GE, and ES (string equality). VALUE The value with which to evaluate FIELD. CMDNUM The order of the command in this data block whose field the test will use. Notes Omit the FIELD, Oper, VALUE, and CMDNUMarguments for an unconditional callback of a function block. You may use parameter substitution by enclosing a parameter name with the %symbol. Use %(I)name%to force conversion of a numeric parameter to integer form. When a call is encountered, it executes and the processing returns immediately to the next line after the call and continues processing. A dialog invoked by the first instance of Cal_will be replaced by the dialog invoked by the second instance of Cal_. We do not recommend using this sequence to call a hidden dialog followed by a call to another dialog. This command must be the last line in a function block, immediately preceding the :E ENDcommand.
Examples The following command will call Fnc_Blockif field number 4 of the second command (the second Cmd_ Block) in the current data control has a value greater than 1 when the current function block executes: Cal_Fnc_Block,4,GT,1,2 The command below calls Fnc_TESTCALL for parameter name='CALL': Cal_Fnc_TEST%name%
Cal_REFRESH Refreshes the lowest active level of the main menu. Function Data Control If input entered in a dialog effect the keywords used to activate a menu item, the menu is refreshed to reflect the new settings.
Cmd_Command Constructs and issues an ANSYS command as part of a function data control block. Function Command Control Command Any valid ANSYS command name. This includes APDL calls, macros, and calls to external libraries. Notes You can include more than one Cmd_data control in a single data block, but not more than 50. If this command shouldn't be included in menu paths, then on the preceding line, add this text: ! Exclude_from_paths Example
The following command issues ANSYS command APLOT, which displays an area plot in the Graphics Window: Cmd_APLOT Note-See "Suppressing ANSYS Commands,"Section 5.2for details on the use of ) and $
Cnt_INTEGER Defines the maximum number of items users can pick for this field, without automatically invoking Apply. Function Picking Data Control INTEGER An integer greater than or equal to 1 but not higher than 1000 (for locational picking) and not more than 9999 (for entity picking). If you omit the integer, it defaults to 1. You can replace INTEGERwith an "l"(the letter l) or an "s,"which doesn't limit entity picking. The "l"is a flag indicating an ordered list of picked items. The "s"is a flag indicating an unordered list of picked items. Notes This command is useful when a user is picking items to create or select and the picked items should be verified before performing the next operation. See Max_to see how to set a maximum value and invoke Apply automatically. See Mok_to see how to set a maximum value with an automatic OK. Examples This command sets the order of selection as unimportant for "Select Entities:" Cnt_s This command limits the number of picked keypoints to 8: Cnt_8
*CPAR(N) Retrieves data stored in the *CSET command vector. Function GUI Control (N) The number of the appropriate vector position. This command usually is used in conjunction with the Typ_Def_command. Example The following commands instruct the ANSYS program to use the data stored in the *CSETvector position 101 as the default value: Typ_Def_*CPAR(101)
CPAR Fetches the double-precision equivalent of the data stored in the *CSET command from an ANSYS *GET command. Function GUI Control Explanation This command usually is used in conjunction with the Typ_Def_command. Example The following command assigns the double-precision equivalent of the data stored in the CSET vector position 101: *GET,_z1,CPAR,101
*CSET,START_LOC,END_LOC,Fields
Stores a string in a vector. Function GUI Control START_LOC An integer between 1 and 150. END_LOC An integer between 1 and 150. To maintain precision, use the START_LOC+ 3 for the ending location. Fields The string to be stored at the location starting at START_LOCand ending with END_LOC. Fill these fields using Fld_controls; each field can hold as many as 32 characters. If the string contains spaces, you must enclose the complete string in single quotation marks, as follows: `my string' Example This command fills the *CSETvector positions 1 through 1 with the following field specifications Cmd_*CSET,1,1 Fld_2: Prm_Name of the ANSYS job Typ_Char Cmd_*CSET,1,1,`This is a test' Notes When settings defaults for filtering, use parameters to set the value first. For example, in an IGES import, you cannot set *.*or *in the Def_statement. Instead, a *PAR of a parameters such as _Z10 is used (_Z10="*.*").
! Cust_Cal_Function_Name Names the function block which the custom dialog calls.
Function Data Control Notes This command can only appear after a comment command (!).
! Cust_Cmd_Command_Name Names the ANSYS command which the custom dialog calls. Function Data Control Notes This command can only appear after a comment command (!).
D
:D String Defines the title of the dialog, and the description of a control file or a menu. (Required for control file and function block headers.) Control File Header, Function Header, Menu Header String A string of 1 to 76 characters. Notes Only the first 60 characters of the string appear in the dialog's title bar. Only the first 22 characters of the string will show in a picking dialog. If you reset the default font size for the dialog boxes, a different number of characters will appear. In menu blocks, this command can be used to store descriptive information about the menu, but the information is not displayed to the user.
Def_String Defines a default value to be used and displayed in this field. Function Field Control String The String, limited to eight characters in length, may be any of the following:
G
G G G G G
the string Blank, which will produce a blank input field. The field also defaults to a blank input field if the value returned from *GET, *PAR, etc. is tiny (2**-100). a numeric value, which sets the default. If the user changes the value for this field, then it overrides the setting for String. The user will see the changed value if no more than 40 other dialog boxes have been shown before this same dialog is called again. a *GET value or a *PAR value which overrides previous user values. More properly, though, the *GET value should match the user value so that when the command is executed, the database is updated and reflects the new user value. Thus, a subsequent entry will get the user value from the database. a *CPAR value which overrides previous user values. a *PICK value, which uses the information from the Typ_XYZ_WP function picking control. a *FENT or *FPIK value. a *Str value, which passes up to 72 characters into a field as one character. a string matching an item in a Lis_ data control. If the string contains spaces, enclose it in single quotes. You can specify up to three default values, separated by commas, as the defaults for double and triple data types (for example, Typ_Real2, Typ_Real3).
Examples Def_*GET(Entity,ENTNUM, Gets a value the same way as the ANSYS *GET command Item1,IT1NUM,Item2,IT2NUM) Def_*PAR(Parm) Evaluates Parm, which is an ANSYS parameter Gets the field N information from the Typ_XYZ_WP picker, where N is a number from 1 to 9.
Def_*PICK(N)
Used for a triple data type Use the 101 value in the CSET vector Produces a blank input field
Dlm_Character Defines the command field delimiter the UIDL processor will use when building the command to send to ANSYS. Function Field Control Character A character, which can be a blank space, to use afterthis field as the delimiter. The default character is a comma. The character "~"causes ANSYS to use no delimiter between fields. Fields are compressed to the last non-blank character. Example The following data block invokes the vi editor for the given filename in the ANSYS Output Window, and sets the delimiter character to a space: Cmd_/SYS Fld_2 Typ_Def_vi Dlm_ Fld_3 Typ_CHAR Prm_Enter Filename
:E END Ends every building block. (Required) Ending Notes Most blocks end with only the :E ENDcommand in the ending section. However, when you are creating online help, you need to insert a blank line immediately before the :E ENDcommand.
END_OF_HYPERLINKS Ends the data controls section and begins a help contents section in a help block. (Required) Help Data Control Notes Even though only ZBITMAP files can contain hyperlinks, this command must appear in all help block data control sections.
F
:F String Defines the name of the GUI control file. (Required) Control File Header String The name of this control file. Example The following example shows the first four required lines of a control file:
*FENT(FIELD,ITEM) Retrieves data stored by the FLST and FITEM commands for entity picks. Function Data Control FIELD The field number associated with the ANSYS command used for the picking. This can be a value between 2 and 9. ITEM The item number for the entities picked by FIELD. The item number can be between 0 and 999. A zero value for the item number returns the number of entities picked. Explanation *FENTbuilds commands based on data previously stored by the FLSTand FITEMcommands from a previous function block. It is typically used in conjunction with the Typ_Def_command.
Fld_N Specifies the field number Function Field Control N The field number of the ANSYS command field. The field definition always begins with Fld_, and ends with the next Fld_or Cmd_control. The Cmd_control immediately preceding the Fld_is related to the field. Notes
The maximum number of Fld_data controls allowed in a function is 80. Specify Fld_0for labels. These will appear in a dialog box as a separate text line, without a text input box attached. Fld_1should not be used explicitly; UIDL associates Fld_1with the command used for the dialog. Example The following example defines Fld_2as a labeled field that will accept a character string of up to eight characters in length: Fld_2 Prm_Name of parameter to be defined Typ_Char,8
Fmt_H Forces narrow horizontal sizing of dialogs. Function Data Control Notes Do not use this command with the Inp_P control. Any Prm_labels will be shown above their corresponding button or data entry field.
Fnc_String Points to the name of a function block from a menu, or defines the internal name of a function. (Required in function headers.) Menu Data Control String The internal name of the function block, indicating a function to be displayed or activated when the user chooses this item from a menu. Notes
*FPIK(FIELD,ITEM) Retrieves data stored by the FLST and FITEM commands for locational picks. Function Data Control FIELD The field number associated with the ANSYS command used for the picking. This can be a value between 2 and 9. ITEM The item number associated with the X, Y, or Z coordinate (in the global Cartesian coordinate system) of the entity chosen with Field. The item numbers correspond to the coordinates of the entities that were picked. The item number can be between 0 and 999 (i.e., there can be 333 coordinate locations). A zero value for the item number returns the number of points picked. Always double check the return value. Explanation *FPIKbuilds commands based on data previously stored by the FLSTand FITEMcommands from a previous function block. It is typically used in conjunction with the Typ_Def_command. Example See Chapter 6for a programming example using *FPIK.
G
*GET(String) Gets a value without first placing it in a parameter. Function GUI Command
String The same format as the ANSYS *GETcommand after the parameter field. Entity Entity keyword. Valid keywords are NODE, ELEM, KP, LINE, AREA, VOLU, etc; see Entity= in the *GETtable in the ANSYS Commands Reference. ENTNUM The number of the entity (as shown for ENTNUM= in the *GETtable in the ANSYS Commands Reference). A zero (or blank) ENTNUM represents all entities of the set. Item1 The name of a particular item for the given entity. Valid items are as shown in the Item1columns of the *GETtable in the ANSYS Commands Reference. IT1NUM The number (or label) for the specified Item1(if any). Valid IT1NUMvalues are as shown in the IT1NUMcolumns of the *GETtable in the ANSYS Commands Reference. Some Item1labels do not require an IT1NUMvalue. Item2, IT2NUM A second set of item labels and numbers to further qualify the item for which data are to be retrieved. Most items do not require this level of information. Notes This command is useful for working with Def_data controls. See the ANSYS Commands Referencefor detailed information on the *GETcommand. For *GEToperations on character commons, CHR4 reads through the common in blocks of four and CHR8 reads through the common in blocks of eight.
:H Hlp_String Points to a help block. Function Header String The internal name of the help block that should be displayed when a user clicks the Help button of the dialog box. Example The following command displays the online help for the RECTNGcommand when a user looks for information about that command: :H Hlp_C_RECTNG Notes Multiple :Hlines are acceptable. To be able to readily create consistent names for help blocks, ANSYS has adopted the following naming conventions:
G G
Hlp_String for a user-created help block. Hlp_C_ANSYSCommandName for a command documented in the ANSYS Commands Reference (the internal name for the help block for AADD is Hlp_C_AADD). A user can enter Help, ANSYSCommandName in the ANSYS Input Window to display online help about the specified command. Hlp_E_S4.ELEMENTNUMBER for an element documented in the ANSYS Elements Reference (the internal name for the help block for LINK8 is Hlp_E_S4.8). A user can enter Help, ELEMENTNUMBER in the ANSYS Input Window to display online help about the specified element. Hlp_T_SSECTIONNUMBER for a section in the ANSYS Theory Reference (the internal name for help block for Section 12.5 is Hlp_T_S12.5). Hlp_G_GuideCHAPTERNUMBER for the Analysis Guides (the internal name for the help block for Chapter 10 of the ANSYS Modeling and Meshing Guide is Hlp_G_MOD10). Hlp_UI_Widget_Name for a screen in the ANSYS GUI Help Manual (the internal name for the help block for the Pan Zoom Rotate control panel is Hlp_UI_Pan_Zoom).
For the help block names for the chapters in the Analysis Guides, Guide is the first three letters of the document title. For instance, in the example shown above, "MOD10" specifies Chapter 10 of the ANSYS Modeling and Meshing Guide. When you are creating help block names for function blocks
that you've written, be sure to give the help block a name similar to the function block to ease software maintenance.
Hlp_Help_Block Points to a help block. Help Data Control Help_Block The internal name of a help block for ASCII or bitmap help. Explanation This control is used to define a sequence of help blocks. The first Hlp_Help_Blockin the help data controls section defines the previous help block in the sequence. The second Hlp_Help_Blockin the help data controls section defines the next help block in the sequence.
Hps_Help_Block Points to a help block; used only for printable PostScript help. Help Data Control Help_Block The internal name of a help block for PostScript help. Explanation This control is used to define a sequence of help blocks when printing PostScript help. The first Hps_Help_Blockin the help data controls section defines the previous help block in the sequence. The second Hps_Help_Blockin the help data controls section defines the next help block in the sequence.
:I 0, 0, 0 Fixed-format placeholder for the UIDL processor-generated index numbers. (Required) Control File Header Explanation The :Icommand must appear as the third line of the control file header, with comma-separated zeros in columns 9, 18, and 27 respectively. When the UIDL processor processes this file, the placeholders are overwritten with index numbers. Always keep a clean copy of every control file with the index line set to 0s. The first field is a placeholder for the total number of building blocks. The second field is the placeholder for the starting location of the :X INDEXin bytes. The third field is a placeholder for the total size of the control file in bytes.
Idx_ Defines categories, items and values for scrolling windows Function Data Control This can only be used with the Typ_Idxcommand. See the Typ_Idxcommand.
Inp_NoApply Suppresses the Apply button in a dialog. Function Data Control Explanation When Inp_NoApplyis used, it must be the first entry in the data controls section. Do not use Inp_NoApplywith the Inp_Pcontrol. Inp_NoApplymust be used with unique specification commands (not available for multiple windows, sets, etc.), an action performed only once, and all visible dialogs of a chain except
Inp_P Acts as a prompt mode flag for including a picking dialog or for a hidden block. Function Data Control Notes This command, if used, must be the first entry in the function data controls block. Don't use this control if a dialog box is to appear for the function block.Do not use this control with the Inp_NoApplycommand. If you use Inp_Pwith a data type (Typ_Control) that includes picking, the picking dialog will be displayed in addition to the prompt window. Do notuse this command to display a prompt window without a picking dialog.
K
:K Keyword Logic Defines logic that must produce a true result before a dialog is shown or menu selections are activated. Header Keyword Logic Keyword logic is an algebraic Boolean operation-"|"is orand "&"is and. You can enclose the logic in parentheses nested up to three levels deep. An uppercase keyword requires that the keyword be set for a true condition to be returned. A lowercase keyword requires that the keyword notbe set for a true condition to be returned. If the keyword produces a false condition, the block is notdisplayed. If you place a "#"symbol before the first parenthesis, the menu item corresponding to the building block is grayed out instead of not being displayed. The Keyword Logicstring can contain up to 76 characters. Keywords may be selected by ANSYS or you can include them in your programming.
Notes You can include more than one :Kline in the Header Section but not more than 10. When you use multiple :Klines, the ANSYS program uses the andlogic between them. This enables you to dim or hide a function based on keywords. Appendix Blists and describes the keywords ANSYS uses. Filtering only works in the first level of the Utility Menu-filtering does not work in cascaded menus. Example The following command specifies that either "PREP7"or"SOLUTION"must be true, and"BEGIN"must be falsein order for the GUI to display the block-ANSYS must be running either in preprocessor or solution mode. :K ((PREP7|SOLUTION)&begin)
K_Type (Keyword Logic) Defines keyword logic that must produce a true result before the identified item will be shown. Function Data Control Type The type of keyword logic used. Possible values are: CM (applies keyword logic to the previous Cmd_) FL (applies keyword logic to the previous Fld_) LN (applies keyword logic to the following line, no matter what control type it is. You can use an unlimited number of K_LN lines.) Keyword Logic The keyword logic is an algebraic Boolean operation, where "|"is orand "&"is and. You can enclose the logic in parentheses nested up to 3 levels deep. An uppercase keyword requires that the keyword be set for a true condition to be returned. A
lowercase keyword requires that the keyword notbe set for a true condition to be returned. If the keyword produces a false condition, the block is notdisplayed. If you place a "#"symbol before the first parenthesis, the menu item corresponding to the block is dimmed (grayed out) instead of not being displayed. The Keyword Logicstring can contain up to 76 characters. Keywords may be selected by ANSYS or you can include them in your programming. Notes You can include more than one K_LN line where andlogic is used between lines. Appendix Blists and describes the keywords ANSYS uses.
L
Lis_ Defines items for lists on dialogs. Function Data Control Explanation This command can only be used with the Typ_Liscommand. See the Typ_Liscommand for a description of how to use Lis_.
M
Max_INTEGER Sets the maximum number of items users can pick for this field, automatically invoking Apply. Function Picking Control INTEGER An integer greater than or equal to 1, but not exceeding 1000 (for locational picking) or 9999 (for entity picking). If you omit the integer, it defaults to 1. You can replace the integer value with an "l"(the letter l) or an "s,"which doesn't limit entity
picking. The "l"is a flag indicating an ordered list of picked items. The "s"is a flag indicating an unordered list of picked items. Notes The ANSYS program does an "Apply"automatically when the user picks the maximum number. See the Cnt_description for information on how to specify a maximum value without doing an Apply. See the description of Mok_to find out how to specify a maximum value with an automatic OK. Examples The following command defines the order of selection as unimportant: Max_s The following command sets the maximum number of picked items at eight: Max_8
Men_String Points to the name of a menu block to display on a menu. Menu Data Control String The internal name of the menu block, which indicates the menu to be displayed when the user picks this item in a menu. Notes The contents of Stringare defined by a :Ncommand in a menu header.
Min_INTEGER Sets the minimum number of items that users must pick for this field. Function Picking Control
INTEGER An integer greater than or equal to 1. If you omit the integer, the default is 1; however, a good practice is to specify a minimum integer value and not rely on the default. Notes This control sets the minimum number of items that must be picked before the ANSYS GUI will accept an Apply or an OK. Example The following control sets the minimum number of picked items to four: Min_4
Mok_INTEGER Sets the maximum number of items users can pick for this field. Function Picking Control INTEGER An integer greater than or equal to 1, but not exceeding 1000 (for locational picking) or 9999 (for entity picking). If you omit the integer, it defaults to 1. You can replace the integer value with an "l"(the letter "l") or an "s,"which doesn't limit entity picking. The "l"is a flag indicating an ordered list of picked items. The "s"is a flag indicating an unordered list of picked items. Notes The ANSYS program does an OK operation automatically when the maximum is picked. See the Cnt_description for information on how to specify a maximum value without an automatic Apply. See the description of Max_to find out how to specify a maximum value with an automatic Apply.
N
:N String Defines the internal name of a building block. (Required) Header String A unique 1- to 12-character name, prefixed with one of the following: Fnc_, for a function block Men_, for a menu block Hlp_, for a help block (Hps_for printable PostScript files) Notes If the same internal block name is defined more than once, ANSYS uses only the lastbuilding block found with that name. Each internal name should be unique. See the :Hdescription for more information on naming help blocks.
P
:P Product Code Logic Defines the product codes that must be present before the building block will be shown. Header Product Code Logic The ANSYS program sets product codes. (A product code identifies the ANSYS products for which your site is licensed.) The product code logic is an algebraic Boolean operation where "|"is orand "&"is and. You can enclose the product code logic in parentheses nested up to 3 levels deep.
An uppercase product code requires that the product code be set for a true condition to be returned. A lowercase product code requires that the product code notbe set for a true condition to be returned. If the product code produces a false condition, the building block will notbe displayed. If you place a "#"symbol before the first parenthesis, the menu item corresponding to the building block will be dimmed (grayed out) instead of not being displayed. The Product Code Logicstring can contain up to 76 characters. Notes You can use only one :Pcommand in the header section of a function block. Appendix Cof this manual lists and describes the ANSYS product codes. Filtering only works in the first level of the Utility Menu-filtering does not work in cascaded menus. Example The following command requires the THERMAL product code to be active before the building block will be displayed (that is, ANSYS/Thermal must be running on the system): :P (THERMAL)
P_Type (Product Code Logic) Defines product code logic that must produce a true result before the identified item will be shown. Function Data Control, Menu Data Control Type The type of product code logic to use. Specify one of the following: CM (product code logic applies to the previous Cmd_) FL (product code logic applies to the previous Fld_) LN (product code logic applies to the following command, no matter what control type it is) Product Code Logic
Product code logic is an algebraic Boolean operation, "|"is orand "&"is and. You can enclose the logic in parentheses nested up to three levels deep. An uppercase product code requires that the keyword be set for a true condition to be returned. A lowercase product code requires that the keyword notbe set for a true condition to be returned. If the keyword produces a false condition, the building block will notbe displayed. If you place a "#"symbol before the first parenthesis, the menu item corresponding to the building block will be dimmed (grayed out) instead of not being displayed. The Product Code Logicstring can contain up to 76 characters. A product code in uppercase letters required that the product code be set to "true."A lowercase product code must be set to false. If a product code produces a false condition, the building block isn'tdisplayed. The Product Code Logic string can contain up to 76 characters. Notes Appendix Cof this manual lists the ANSYS product codes.
*PAR(_ZString) Retrieves data stored in a parameter. Function GUI Control _ZString A parameter that was previously defined. This command is used in conjunction with the Def_or Typ_Def_command. Example The following example uses the parameter _Z1 as the default node number. Fld_4 Prm_Node number N Typ_INT Def_*PAR(_Z1)
Pcn_FLAG Specifies whether a set of picked entities should or should not be ordered for retrieval picking. Function Picking Control FLAG One of the following values: 0, for an ordered set (default) 1, for an unordered set 2, where the first item chosen is the first in the set and the other items are unordered. This is available for loop picking and single picks. Notes For an ordered set, the following picking dialog buttons will be dimmed: Box, Polygon, Circle, and Pick All.
Pdp_FLAG Controls whether the user can pick duplicates of an entity for retrieval picking Function Picking Control FLAG One of the following values: 0, if no duplicates are allowed (default) 1, to allow duplicates of an entity
Function Picking Control FLAG One of the following values: 0, to have the UIDL processor determine if a picked set or the command line should be used (default). 1, to use a picked set (The ANSYS commands FITEMand FLSTwill be used.) 2, to place the picked items directly on the command line (The ANSYS commands FITEMand FLSTwill notbe used.)
*PICK(N) Retrieves the data in the Nth text field of the model picker. Function Picking Control (N) The text field number of the model picker Example In the following example, two working plane locations (the two diagonal corners of a rectangle) are picked: :N Fnc_BLC4_2d :S 0, 0, 0 :T Cmd_P :c )! Fnc_BLC4_2d :A By 2 Corners :D Rectangle by 2 corners :K #(PREP7) :H Hlp_C_BLC4 Inp_P Cmd_BLC4 Fld_0 Typ_XYZ_WP Prm_[BLC4] Pick 2 WP locations (2 diagonal corners)
Min_2 Max_2 Rub_ Fld_2 Typ_Def_*PICK(1) Fld_3 Typ_Def_*PICK(2) Fld_4 Typ_Def_*PICK(3) Fld_5 Typ_Def_*PICK(4) :E END
Prm_String Defines the label (or prompt) to be used with this field. Function Field Control String The string can contain up to 72 characters but will be truncated to 32 characters when in a dialog box for any data type (Typ_) other than Typ_Lab. Notes You can substitute ANSYS parameters in the labels by enclosing them with %symbols. Consider this command: Prm_Specify %num% widgets that are %color%. If the %num%parameter is set to 5 and the %color%parameter is set to green, the text string will read: Specify 5 widgets that are green. Use the %#parameter% to prevent compression of spaces in a character parameter. Example The following command specifies the prompt, "Enter fillet radius."
Pwr_FLAG Switches the FLST and FITEM off and on for a field. Function Field Control FLAG One of the following: 0, to have FITEMand FLSTwrite the items (default) 1, to disable writing of items by FITEMand FLST Notes This command enables the storage of picked items or coordinates for retrieval by the *FENTor *FPIKcommands.
R
Rmk_ Rebuilds the dialog box after an Apply operation. Function Data Control Notes This control must be the first line of the Data Controls section.
Function Picking Control N A numeric key from the following list: For Two-dimensional Picking on the Working Plane 1 2 3 4 5 6 7 8 Lines Rectangle (Corner - Opposite Corner) Circle (Center - Radius) Annulus (Center - R1 & R2) Partial Annulus Rectangle (Center - Corner) Circle (On Circle - On Circle) Rectangle (Center - Edge)
13 3 Equal-sided Polygon 14 4 Equal-sided Polygon 15 5 Equal-sided Polygon 16 6 Equal-sided Polygon 17 7 Equal-sided Polygon 18 8 Equal-sided Polygon
For Three-dimensional Picking Between Keypoints 51 Straight Lines 52 Lines In Active Csys 53 Area In Active Csys 54 Area With Straight Lines For Three-dimensional Picking on the Working Place Plus Z Dimension 101 Polyhedron 102 Block 103 Cylinder-solid 104 Cylinder-hollow 105 Partial Cylinder 106 Block (Center - Corner) 107 Cylinder-solid (On Circle - On Circle) 109 Cone 113 3 Equal-sided Polyhedron 114 4 Equal-sided Polyhedron 115 5 Equal-sided Polyhedron 116 6 Equal-sided Polyhedron
117 7 Equal-sided Polyhedron 118 8 Equal-sided Polyhedron For Electrical Circuits (3 Points to Create) 201 Inductor 202 Capacitor 203 Resistor 204 Circuit 1 205 Circuit 2 206 Circuit 3 207 Circuit 4
S
:S 0, 0, 0 Fixed-format placeholder for the UIDL processor-generated index numbers. (Required) Header Explanation The :Scommand must appear as the second line of every header section, with comma-separated zeros in columns 9, 16, and 23 respectively. When the UIDL processor processes a block, the placeholders are overwritten with index numbers. Always keep a clean copy of every block with the index line set to 0s. The first field is a placeholder for the size of the block in bytes. The second field is the
placeholder for the start index of the data controls section in bytes. The third field is a placeholder for the total size of the data controls section in bytes.
Sel_FLAG Defines the type of selection picking that is allowed. Function Picking Control FLAG One of the following values: s, to allow only currently selected entities to be picked (default). 1, to pick all defined entities, whether or not they're selected. Use this setting only for retrieval picking. u, to allow picking only entities that currently aren't selected.
*Str(String) Passes character information into a field as a character. GUI command (String) A string containing up to 72 characters. You can include ANSYS parameters in the string by enclosing them with %symbols (%parameter%). Use %#parameter%to prevent compression of spaces in a character parameter. If a parameter causes the string to exceed 72 characters, the string is truncated.
This command is used with the Typ_Def_and Def_commands, Example The following block reads a file into ANSYS: F1=`/usr/loc` F2=`al/ansys` F3=`file.in` F4=`p` Cmd_/INPUT Fld_2 Typ_Def_*Str(%F1%%F2%%F3%%F4%)
T
:T Type Specifies the type of data controls a building block will use. (Required) Header Type One of the following types: Menu Defines the block as a menu block. The data controls section contains the internal names of the submenus and functions. The ANSYS program automatically appends a ">"symbol on the menu to the names (specified on the :Aline) of menu blocks having submenus. Cmd Defines the block as a function block. An ellipses (...) appears on the menu after the name of each dialog. Cmd_N
Defines the block as a function block. No symbol will be shown (this indicates immediate action). This is used for a hidden dialog. Cmd_P Defines the block as a function block for a picking dialog. The symbol + appears on the menu after the name of each picking box. Help Defines the block as a help block. Help blocks can be in ASCII, bitmap (XWD) or PostScript format (PostScript is used for printable help only). Finish Defines the block as a "finish block."Using this data type and the FINISHcommand collapses the side menus automatically to the top level when a user chooses this command. Notes Changing the function block type changes only the symbol shown, not the functionality of the function itself.
Typ_Entity Uses picking mode to obtain entity numbers for commands requiring them. Function Picking Control Entity Use one of the following values for Entity: NODE Pick node numbers from the screen. ELEM Pick element numbers from the screen. KEYP Pick keypoint numbers from the screen.
LINE Pick line numbers from the screen. AREA Pick area numbers from the screen. VOLU Pick volume numbers from the screen. TRAC Pick trace point numbers from the screen. Notes Use this data type only in the Inp_P control mode.
Typ_Char,FIELD1,FIELD2 Creates a text entry field for character data display. Function Character Control FIELD1 An integer between 1 and 80 for maximum character input (defaults to 80). FIELD2 An integer between 1 and 80 for the input field view width (defaults to 32).
Typ_Color Creates an option button with 16 color choices available. Function Listing Control Explanation The default prompt for Typ_Coloris Color. The color chosen passes the actual color name to the field. If you want to set a default color (Def_line), the correspondence shown below applies for the default ANSYS color map. (If using a *GETcommand to fetch a color value, you must add 1 to it to match this table.)
1 BLAC 5 BLUE 9 GREE 13 RED 2 MRED 6 CBLU 10 YGRE 14 DGRA 3 MAGE 7 CYAN 11 YELL 15 LGRA 4 BMAG 8 GCYA 12 ORAN 16 WHIT
If you do not specify any parameters, ANSYS produces a selection list in the dialog that looks like this:
The user selects a color, and the button is shown in the color selected.
Typ_Def_String Defines a hidden default value to be used but not displayed. Function Field Control String The String, limited to eight characters in length, may be any of the following:
G G
a numeric value, which sets the default. a *GET value or a *PAR value which overrides previous user values. More properly, though,
G G G G
the *GET value should match the user value so that when the command is executed, the database is updated and reflects the new user value. Thus, a subsequent entry will get the user value from the database. a *CPAR value which overrides previous user values. a *PICK value, which uses the information from the Typ_XYZ_WP function picking control. a *FENT or *FPIK value. a *Str value, which passes up to 72 characters into a field as one character. You can specify up to three default values, separated by commas, as the defaults for double and triple data types (for example, Typ_Real2, Typ_Real3).
Examples Typ_Def_*GET(Entity,ENTNUM, Gets a value the same way as the ANSYS *GET command Item1,IT1NUM,Item2,IT2NUM) Typ_Def_*PAR(Parm) Evaluates Parm, which is an ANSYS parameter Gets the field N information from the Typ_XYZ_WP picker, where N is a number from 1 to 9. Used for a triple data type Use the 101 value in the CSET vector
Typ_Def_*PICK(N)
Typ_Def_*PAR(_z1),*PICK(3),5 Typ_Def_*CPAR(101)
Typ_File Creates the file selection box, which displays the filter, directory, and file name. Function File Control Explanation Using this control produces a standard selection box on a dialog. The user can select a file, browse directories to find a file, or filter the contents of a directory according a user-specified extension.
Typ_File_Inline
Creates a text entry field for the directory, filename and extension. Function File Control Explanation Creates a text entry field. When the user enters a string, it is converted automatically into the ANSYS format of Filename,Extension,Directory. The filename is limited to 32 characters, the extension to 9 characters, and the directory name to 39 characters.
Typ_Idx Creates an indexed list for side-by-side display of categories and their associated items. Function Listing Control Idx_Category,Item,Value Defines each line of the scrolling lists. You must identify each item using the Idx_designator, followed by the category, item, and value. All categories are shown once in the left scrolling list. Each time a user chooses a category, all the items associated with that category appear in the right scrolling list. When a user chooses a specific item, the name of the item appears in a field labeled Selection. Example The following example creates a pair of scrolling lists permitting a user to select coordinate data about the model: Fld_2 Prm_Coord sys data to be retrieved Typ_IDX IDX_Origin location ,X ,LOC,X IDX_Origin location ,Y ,LOC,Y IDX_Origin location ,Z ,LOC,Z IDX_Rotation angle ,XY ,ANG,XY IDX_Rotation angle ,YZ ,ANG,YZ IDX_Rotation angle ,ZX ,ANG,ZX IDX_Attributes ,Coord sys type ,ATTR,KCS IDX_Attributes ,Ratio Y-rad/X-rd,ATTR,PAR1 IDX_Attributes ,Ratio Z-rad/X-rd,ATTR,PAR2
Here is the function block as it would appear in a dialog if a user had selected the Coord sys typeitem from the Attributescategory:
Typ_Int Creates a text entry field for displaying integer data. Function Numeric Control Notes Using this command does not prevent non-integer data from being entered. Typ_Inttakes the default and converts it to an integer before displaying it.
Typ_Int2 Creates two side-by-side text entry fields for displaying integer data. Function Numeric Control
Typ_Int3 Creates three side-by-side text entry fields for displaying integer data. Function Numeric Control
Typ_Lab Defines a label data type which is used to display labels without an associated button or entry field. Function Field Control Explanation Specify the labels using the Prm_control. Typ_Labusually is used with the Fld_0control. You can use multiple Fld_0controls in a data block. Example Fld_0 Typ_lab Prm_ Enter part name
Typ_Lis Displays a list of choices for a field. Function Field Control Explanation You can specify a number of types of lists: Single-selection Scrolling Lists Typ_Lis Lis_Item,Value Use one Lis_ designator for each item on the list. Each item name can be 16 characters long, and will be shown in a scrolling window. The associated value of an item will be used by the command field. Multiple-selection Scrolling Lists Typ_MLis Lis_Item,Value
Use one Lis_ control for each item. The item name can be up to 16 characters long, and is shown in a scrolling window. The item's associated value is used by the command field. See the Bnd_command to learn how to limit the number of choices. Each item selected is separated by a comma. Radio Buttons Typ_Lis_RadioB Lis_Item,Value Use one Lis_ designator for each item. The item name is shown as a radio button. The associated value of an item is used by the command field. Option Buttons Typ_Lis_OptionB Lis_Item,Value Use one Lis_ designator for each item. The list of items is shown as a single option button. The associated value of an item is used by the command field. Database Read, Single-selection, or Multiple-selection Scrolling List Typ_Lis or Typ_MLis Lis_*READ,Item Current database items will be displayed in a scrolling window, from which the user can select one or more items. The selected item(s) will be used by the command field. Itemwill have one of the following values: DOF Current degree-of-freedom set F Current force set CM Current defined components ASSM Current defined assemblies ETAB Current element table items PATH Current path items DV Current design variables SV Current state variables OBJ Current objective function PAR Current parameters PARX Current parameters notused as opt. variables FIT Current fitting functions MAT Current material numbers OPTH Current list of paths TYPE Current element types REAL Current real constant numbers
Typ_Logi,Off_Label,On_Label Creates an on/off toggle button. Function Logical Control Off_Label An optional character string containing up to 16 characters. On_Label An optional character string containing up to 16 characters.
Typ_MLis Displays a list of choices for a field, permitting multiple choices. Function Listing Control Explanation See the description of the Typ_Liscontrol for complete information.
Typ_Real Creates a text entry field for real number display. Function Numeric Control
Typ_Real2 Creates two side-by-side text entry fields for real number display. Function Numeric Control
Typ_Real3 Creates three side-by-side text entry fields for real number display. Function Numeric Control
Typ_Resu Enables the user to view results interactively on the screen by picking. Function Picking Control Explanation To pass a parameter to the ItNdescriptor, use *CPAR(N). The IT vector is an A32 data type, and IT0_Stringwill set the entire vector. The entity can be a node or an element, and the Itemand Componentare any items and components that can be plotted. Specify the entity to be shown as IT1_Entity, the item to be shown as IT2_Item, and the component to be shown as IT3_Component.
Typ_Sep Displays a separator bar in a dialog. Function Data Control Notes This control should follow a Fld_0control. Do not use with prompt mode.
Typ_XYZ Obtains the coordinates of a point in picking mode. Function Picking Control
Notes Use this control only with the Inp_Pcontrol mode. You also can use Typ_XYZin conjunction with the Pwr_1and Typ_Def_*FPIKUIDL function controls.
Typ_XYZ_SCREEN Obtains the screen coordinates of a point in picking mode. Function Picking Control Notes You can use this control only with the Inp_Pcontrol mode. The picking dialog displays automatically.
Typ_XYZ_WP Invokes the model picker which obtains the working plane coordinates of a point in picking mode and other geometry information based on Rub_. Function Picking Control Notes To use this control, chain two function blocks. The data is stored in the PICK vector, and you can extract it to a command in a chained function block by using Typ_Def_*PICK(N). You must use Typ_XYZ_WPwith the Typ_Def_*PICKfunction control. You can pick up to six points.
U
*UILIST,Fname,Ext,Dir Displays a named file in the ANSYS GUI lister window. GUI Command
Fname The name of the file. Ext The extension of that file. Dir The directory where the file resides. Dirdefaults to the current working directory. Enclose the directory name in single quotation marks (for example, 'mydir'). Notes You must use this command with the Cmd_function command control.
X
:X INDEX UIDL processor inserts this line at the end of every control file. UIDL processor-inserted Command Do not use this line in blocks.ANSYS inserts this line automaticallyat the end of every control file. ANSYS also writes the contents of each :Ncommand line, and shows the byte count of its location in the control file.
"SYSTEM" 1 IEEE X11 X11C X3D LEVEL ANSYS Exit 1/0 1 1 1 1/0
/EXIT,(blank) /EXIT,MODEL /EXIT,SOLU /EXIT,ALL /EXIT,NOSAV /SHOW /SHOW,X11 /SHOW,X11C /SHOW,X3D Routine Entry /PREP7 /SOLU /POST1 /POST26 /OPT /RUNSTAT /AUX2 /AUX12
0 0
1 1 1
X11C&X3D 0 X11&X3D 0
X11&X11C 0
PREP7
0 0 0 0 0 0 0 0
Other routine names = 0 Other routine names = 0 Other routine names = 0 Other routine names = 0 Other routine names = 0 Other routine names = 0 Other routine names = 0 Other routine names = 0
AUX15
BEGIN
1 1 1
1. Read keyword settings from .db file RESUME 2. Re-establish the following keywords from the current stat of ANSYS: "routine" = 1 (current routine name) "system" = 1 (current system name) LEVEL = 1/0 (GUI on or off) 1. Set all keywords to zero CLEAR 2. Re-establish the following keywords from the current stat of ANSYS: "routine" = 1 (current routine name) "system" = 1 (current system name) LEVEL = 1/0 (GUI on or off)
/CLEAR
If DOFGRP = n0000 (n>0) If DOFGRP = 0n000 (n>0) If DOFGRP = 00n00 (n>0) If DOFGRP = 000n0 (n>0) If DOFGRP = n000n (n>0) See Element Specific Keywords Any combination of two or more of the above
MULTIFLD 1 Preferences Dialog Box PR_STRUC PR_THERM PR_ELMAG PR_FLUID PR_CFD PR_MULTI PR_SET /PMETHOD PMETHOD 1
These are set to a value of one if they are chosen in the "Preferences" dialog box.
If P-Method is turned on
Command/Status SOPTCM Variable Val Keyword DEFAULT ANTYPE ANCONT ANTYPE, STATIC BUCKL MODAL HARMIC TRANS SUBST SPECT NTYPE,, NEW RESTA BUCOPT, REDUC SUBSP EXTOPT EXTOPT 0 1 REDUCED SUBSPACE ANCONT ANCONT 0 1 NEWANLY RESTART ANTYPE ANTYPE ANTYPE ANTYPE ANTYPE ANTYPE ANTYPE 0 1 2 3 4 7 8 STATIC 0 0 STATIC NEWANLY
Val Comments
1 1
HARMONIC 1 TRNSIENT 1
SUBSTRUC 1 SPECTRUM 1
1 1
RESTART = 0 NEWANLY = 0
1 other "options" = 0 1
HROPT, REDUC FULL MSUP MODOPT, REDUC SUBSP UNSYM DAMP TRNOPT, REDUCED FULL MSUP SPOPT, SPRS DDAM MPRS PSD SPANAL SPANAL SPANAL SPANAL 0 1 2 3 SINGLEPT DDAM MULTIPNT 1 1 other "options" = 0 1 TRNOPT TRNOPT TRNOPT 1 0 2 REDUCED FULL MODESUP 1 1 1 other "options" = 0 EXTOPT EXTOPT EXTOPT EXTOPT 0 1 3 4 REDUCED SUBSPACE 1 1 other "options" = 0 UNSYMMET 1 DAMPED 1 HRMOPT HRMOPT HRMOPT 1 0 2 REDUCED FULL MODESUP 1 1 1 other "options" = 0
PSDRANDM 1
FMAGBC, command issued otherwise MOPT, AMESH,RV51 AMESH,RV52 MeshTool MOPTRV51 1 MOPTRV51 0 MESHTOOL 1 FMAGBC FMAGBC 1 0
VECTORP 1 ANISO 1
If KEYOPT(1) = 0, 4, 6
PLANE53 ELEM2D 1
SCALARP 1
1 If KEYOPT(1)= 0
If KEYOPT(1)= 0 If KEYOPT(1)= 1
FLUID142 CFD 1
CFD FLOTRAN K_FL(PR_CFD*CFD) P-Method Loads / Solution :K (PR_STRUC*pr_set) :K #(STRUCTRL) :K (PR_THERM*pr_set) :K #(THERMAL) K_FL(PMETHOD+pr_cfd+cfd)
Structural
Thermal
Electromagnetic
ANSYS Fluid
CFD FLOTRAN
Results Data Utility Menu Dialog Box Structural Thermal :K #(POST1+RESULTS) :K #(POST1+RESULTS) K_FL(STRUCTRL+multifld) K_FL(THERMAL+multifld)
Structural
Thermal
Electromagnetic
ANSYS Fluid
CFD FLOTRAN
ANSYS/Mechanical
ANSYS/PrepPost
ANSYS/University
FULL_ANS LINPLUS THERMAL E3 ELECMAG FLOTRAN MULTDISC FULL_ANS LINPLUS THERMAL E3 ELECMAG FLOTRAN MULTDISC ED FULL_ANS LINPLUS THERMAL E3 ELECMAG FLOTRAN MULTDISC FULL_ANS LINPLUS THERMAL E3 ELECMAG FLOTRAN MULTDISC LSDYNA PP FULL_ANS LINPLUS THERMAL E3 ELECMAG FLOTRAN MULTDISC LSDYNA
ANSYS/ResearchFS
ANSYS/ED
To see the value of keywords, type keyword,stat in the ANSYS Input window. To see the value of product code words, type prdw,stat. To see the values of GUI parameters, type *stat,_parameter. To eliminate keyword or product code filtering during debugging, set the NOFILTER flag. Filtering only works in the first level of the Utility Menu-filtering does not work in cascaded menus. Do not use a ! and a blank on a line without additional characters. Do not edit the control file once it's been indexed by ANSYS. Always edit the clean copy, as described in Chapter 1.
D.2 Troubleshooting
D.2.1 Troubleshooting Dialogs
Dialog does not appear when selected. The dialog may not be properly indexed. Check the function control file-If the :S command still has 0s, it means that block is ignored by ANSYS. Check to make sure the :E END command appears at the end of the block.
The procedures for building help, which are directly related to UIDL coding, are documented in Chapter 4. However, some additional help-building tools are available at the ANSYS FTP site. Since these Perl tools are not part of a formal ANSYS product, and since online help can be built without them, we are documenting them separately in this appendix, with the following warning: NEITHER ANSYS, INC., NOR ITS DISTRIBUTORS, SHALL BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING, BUT NOT LIMITED TO, DIRECT INDIRECT, SPECIAL, CONSEQUENTIAL OR INCIDENTAL DAMAGES, LOSS OF BUSINESS PROFITS, LOSS OF REVENUE, OR LOSS OF USE, ARISING OUT OF OR RELATED TO THE INFORMATION PROVIDED HEREIN, WHETHER SUCH DAMAGES ARISE IN CONTRACT, TORT, NEGLIGENCE, IN EQUITY OR ARE STATUTORY, AT LAW OR OTHERWISE. FURTHER ANSYS, INC. SHALL NOT BE RESPONSIBLE FOR ANY ERRORS IN OMISSIONS PROVIDED HEREIN, AND RESERVES THE RIGHT TO MAKE CHANGES WITHOUT NOTICE. THE INFORMATION PROVIDED HEREIN IS PROVIDED "AS IS"WITHOUT WARRANTY OF ANY KIND, AND ANSYS, INC. DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
4. Type prompt to turn prompting off. 5. Type mget * to download all the files in the GUI_Tools directory. 6. Type quit to close the FTP connection. Most of the files you have downloaded are scripts which will run on either Unix or Windows machines. An executable, compress.exe, is provided for Windows users-Unix users must delete this file. A readme file is included. Print this file for further instructions.
1.1.11 Activating UPFs 1.1.12 Running Your Custom Executable 1.1.13 Verifying Your Routines 1.1.14 Debugging Commands 1.1.14.1 Tracking the Path of Program Logic 1.1.14.2 Debugging Elements and Solutions 1.1.15 Other Useful Commands 1.1.16 Generating Output 1.2 Reading Large Data Files More Rapidly 1.2.1 EBLOCK Command Format 1.2.2 NBLOCK Command Format 1.3 Routines for Creating New Elements 1.3.1 Input and Output Abbreviations 1.3.2 User Routines 1.3.3 Subroutine uec100 (Defining Characteristics of the usr100 Routine) 1.3.3.1 Subroutines uec101 through uec105 1.3.4 Subroutine uex100 (Overriding Element Characteristic Defaults) 1.3.4.1 Subroutines uex101 through uex105 1.3.5 Subroutine uel100 (Computing Element Matrices, Load Vectors, and Results)
1.3.6 Subroutines uel101 through uel105 1.3.7 Subroutine uep100 (Printing Output for User Elements) 1.3.8 Subroutines uep101 through uep105 1.3.9 Subroutine usertr (Adjusting the Nodal Orientation Matrix) 1.3.10 Subroutine userac (Accessing Element Information) 1.4 Supporting Subroutines for Element Creation 1.4.1 Subroutine nminfo (Returning Element Reference Names) 1.4.2 Subroutine svgidx (Fetching the Index for Saved Variables) 1.4.3 Subroutine svrget (Fetching Saved Variable Data for an Element) 1.4.4 Subroutine svrput (Writing an Element's Saved Variable Set) 1.4.5 Subroutine svpidx (Writing the Saved Variable Element Index to a File) 1.4.6 Subroutine mreuse (Determining Which Element Matrices Can Be Reused) 1.4.7 Subroutine subrd (Reading Element Load Data for a Substructure Generation Run) 1.4.8 Subroutine subwrt (Writing an Element Load Vector to a File for a Substructure Generation Run) 1.4.9 Subroutine rvrget (Fetching Real Constants for an Element) 1.4.10 Subroutine propev (Evaluating a Group of Material Properties) 1.4.11 Subroutine prope1 (Evaluating One Material Property) 1.4.12 Subroutine pstevl (Evaluating EX, NUXY, GXY, ALPX, and DENS at Element Temperature)
1.4.13 Function gtplop (Retrieving the Start Point for Plastic Data) 1.4.14 Function gtcrop (Retrieving the Start Position for Creep Data) 1.4.15 Function gtswop (Retrieving the Start Position for Swelling Data) 1.4.16 Subroutine tbuser (Retrieving User Table Data) 1.4.17 Subroutine plast1 (Updating an Element's Plastic History) 1.4.18 Subroutine creep1 (Updating an Element's Creep History) 1.4.19 Subroutine swell1 (Updating an Element's Swelling History) 1.4.20 function nlget (Retrieving Material Non-Linear Property Information) 1.4.21 Subroutine usereo (Storing Data in the nmisc Record) 1.4.22 Subroutine eldwrt (Writing Element Data to a File) 1.4.23 Subroutine eldwrn (Writing Element Nonsummable Miscellaneous Data to the Results File) 1.4.24 Subroutine trrot (Computing the Rotation Vector) 1.4.25 Subroutine rottr (Computing the Transformation Matrix) 1.4.26 Subroutine xyzup3 (Updating an Element's 3-D Nodal Coordinates) 1.4.27 Subroutine updrot (Updating the Rotation Pseudovector) 1.4.28 Subroutine tmpget (Defining Current Temperature Loads) 1.4.29 Subroutine prsget (Defining Current Pressure Loads) 1.4.30 Subroutine cnvget (Defining Current Convection Loads) 1.4.31 Subroutine hgnget (Defining Current Heat Generation Loads)
1.5 Routines for Modifying and Monitoring Existing Elements 1.5.1 Subroutine userfd (Computing the Complex Load Vector for Frequency Domain Logic) 1.5.2 Subroutine userou (Storing User-Supplied Element Output) 1.5.3 Subroutine useran (Modifying Orientation of Material Properties) 1.5.4 Subroutine usanly (Modifying Orientation of Material Properties and Stresses of Layers) 1.5.5 Subroutine userrc (Performing User Operations on COMBIN7 and COMBIN37 Parameters) 1.5.6 Function userpe (Calculating Rotation Caused by Internal Pressure) 1.5.7 Subroutine UElMatx (Accessing Element Matrices and Load Vectors) 1.5.8 Subroutine UTHICK (Getting User-defined Initial Thickness) 1.5.9 Subroutine USTRESS (Getting User-defined Initial Stress) 1.6 Routines for Customizing Material Behavior 1.6.1 Subroutine userpl (Writing Your Own Plasticity Laws) 1.6.2 Subroutine usercr (Writing Your Own Creep Laws) 1.6.3 Subroutine usersw (Writing Your Own Swelling Laws) 1.6.4 Subroutine uservp (Updating Nonlinear Strain History for Materials) 1.6.5 Subroutine userck (Checking User-Defined Material Data) 1.6.6 Subroutine usrhyp (Computing Derivatives of Strain Energy Density with Respect to Invariants)
1.6.7 Subroutine usrogp (Computing Derivatives of Strain Energy Density with Respect to Stretch Ratios) 1.6.8 Subroutine usrogd (Computing Derivatives of Strain Energy Density with Respect to Stretch Ratios) 1.6.9 Subroutine usermc (Controlling Hygrothermal Growth) 1.6.10 Subroutine usermu (Supplying a Friction Coefficient for CONTAC48 and CONTAC49) 1.6.11 Subroutine usrfc6 (Defining Custom Failure Criteria) 1.6.12 Subroutines usrfc1 through usrfc5 1.6.13 Subroutine UserVisLaw (Defining Viscosity Laws) 1.6.14 Supporting Function egen 1.7 Routines for Customizing Loads 1.7.1 Subroutine usrefl (Changing Scalar Fields to User-Defined Values) 1.7.2 Subroutine userpr (Changing Element Pressure Information) 1.7.3 Subroutine usercv (Changing Element Face Convection Surface Information) 1.7.4 Subroutine userfx (Changing Element Face Heat Flux Surface Information) 1.7.5 Subroutine userch (Changing Element Face Charge Density Surface Information) 1.7.6 Subroutine useracel (Modifying an Element's Acceleration/Angular Velocity Information) 1.7.7 Examples of Using the Load Customization Routines 1.7.7.1 Example of Using usercv 1.7.7.2 Effect of useracel on Results
1.8 Running ANSYS as a Subroutine 1.9 Defining Your Own Commands 1.9.1 Function user01 1.9.2 Function user02 (Demonstrates Offsetting Selected Nodes) 1.9.3 Function user03 (Demonstrates Using Heap Memory) 1.9.4 Functions user04 through user10 1.10 Supporting Subroutines 1.10.1 Function GetRForce (Getting Nodal Reaction Force values) 1.10.2 Function GetStackDisp (Getting Current Displacement Values) 1.10.3 Subroutine ElResultStrt (Getting Load Data from Analysis Results) 1.10.4 Subroutine ElResultGet (Getting Results Values at Selected Points) 1.10.5 Subroutine ElInterp (Finding Element Coordinates) 1.11 Access at the Beginning and End of Various Operations 1.12 Creating Your Own Optimization Routine 1.12.1 Linking a Custom Optimization Program to ANSYS 1.12.2 Subroutine userop (Defining a Custom Optimization Routine) 1.12.3 Structuring Your Input 1.12.3.1 Example of User Input for Optimization 1.12.4 Using a Stand-Alone Optimization Program
1.12.5 What Does Jobname.OPT Contain? 1.13 Data Handling Routines 1.13.1 Using the Memory Management Routines 1.13.2 Function HeapAllocPtr (Allocating Heap Space and Returning a Pointer) 1.13.3 Subroutine HeapDealloc (Deallocating Heap Space) 1.13.4 Function HeapGetPtr (Returns a Pointer for a Handle) 1.14 Parameter Processing Routines 1.14.1 Subroutine pardim (Creating a Dimensioned Parameter) 1.14.2 Function parevl (Finding and Evaluating a Parameter) 1.14.3 Subroutine pardef (Adding a Parameter) 1.15 Miscellaneous Useful Functions 1.15.1 Using Function runcmd 1.15.2 Using the /UNDO Command 1.15.3 Using the /HOLD command
2.4.2 ndprev Function (Getting the Number of the Previous Selected Node) 2.4.3 ndnxdf Function (Getting the Number of the Next Defined Node) 2.4.4 ndsel Function (Selecting, Unselecting, Deleting, or Inverting a Node) 2.4.5 elnext Function (Getting the Number of the Next Element) 2.4.6 elprev Function (Getting the Number of the Previous Selected Element) 2.4.7 elnxdf Function (Getting the Number of the Next Defined Element) 2.4.8 elsel Subroutine (Selecting, Unselecting, Deleting, or Inverting an Element) 2.5 Node Information Routines 2.5.1 ndinqr Function (Getting Information About a Node) 2.5.2 getnod Function (Getting a Nodal Point) 2.5.3 putnod Function (Storing a Node) 2.5.4 ndgall Function (Getting the XYZ/Rotation Coordinates Vector for a Node) 2.5.5 ndspgt Subroutine (Getting the Nodal Solution for a Node of an Element) 2.6 Element Attribute Routines 2.6.1 elmiqr Function (Getting Information About an Element) 2.6.2 elmget Function (Getting an Element's Attributes and Nodes) 2.6.3 elmput Subroutine (Storing an Element) 2.6.4 etyiqr Function (Getting a Data Item About an Element Type)
2.6.5 etyget Function (Getting Information About an Element Type) 2.6.6 etyput Subroutine (Storing Element Type Data) 2.6.7 echrtr Subroutine (Getting Information About Element Characteristics) 2.6.8 etysel Subroutine (Selecting, Unselecting, Deleting, or Inverting an Element Type) 2.6.9 mpinqr Function (Getting Information About a Material Property) 2.6.10 mpget Function (Getting a Material Property Table) 2.6.11 mpput Subroutine (Storing a Material Property Table) 2.6.12 mpdel Subroutine (Deleting a Material Property Table) 2.6.13 rlinqr Function (Getting Information About a Real Constant Set) 2.6.14 rlget Function (Getting Real Constant Data) 2.6.15 rlsel Subroutine (Selecting or Deleting a Real Constant Set) 2.6.16 csyiqr Function (Getting Information About a Coordinate System) 2.6.17 csyget Function (Getting a Coordinate System) 2.6.18 csyput Subroutine (Storing a Coordinate System) 2.6.19 csydel Subroutine (Deleting a Coordinate System) 2.6.20 userac Subroutine (Demonstrates Use of Element Attribute Routines) 2.7 Coupling and Constraint Routines 2.7.1 cpinqr Function (Getting Information About a Coupled Set)
2.7.2 cpget Function (Getting a Coupled Set) 2.7.3 cpput Subroutine (Storing a Coupled Set) 2.7.4 cpsel Subroutine (Selecting or Deleting a Coupled Set) 2.7.5 ceinqr Function (Getting Information About a Constraint Equation Set) 2.7.6 ceget Function (Getting an Constraint Equation) 2.7.7 ceput Subroutine (Storing a Constraint Equation) 2.7.8 cesel Subroutine (Deleting or Selecting a Constraint Equation) 2.8 Nodal Loading Routines 2.8.1 disiqr Function (Getting a Information About Constraints) 2.8.2 disget Function (Getting a Constraint from the Database) 2.8.3 disput Subroutine (Storing a Constraint at a Node) 2.8.4 disdel Subroutine (Deleting a Constraint at a Node) 2.8.5 foriqr Function (Getting Information About Nodal Loads) 2.8.6 forget Function (Getting a Constraint from the Database) 2.8.7 forput Subroutine (Storing a Nodal Load at a Node) 2.8.8 fordel Subroutine (Deleting a Nodal Load at a Node) 2.8.9 ntpiqr Function (Getting Information About a Nodal Temperature) 2.8.10 ntpget Function (Getting a Specified Nodal Temperature) 2.8.11 ntpput Subroutine (Storing a Nodal Temperature) 2.8.12 ntpdel Subroutine (Deleting a Nodal Temperature)
2.8.13 nhgiqr Function (Getting Information About Nodal Heat Generations) 2.8.14 nhgget Function (Getting a Nodal Heat Generation) 2.8.15 nhgput Subroutine (Storing Nodal Heat Generation) 2.8.16 nhgdel Subroutine (Deleting a Nodal Heat Generation) 2.8.17 nfuiqr Function (Getting Information About Nodal Fluences) 2.8.18 nfuget Function (Getting a Nodal Fluence) 2.8.19 nfuput Subroutine (Storing a Nodal Fluence) 2.8.20 nfudel Subroutine (Deleting a Nodal Fluence) 2.8.21 ndciqr Function (Getting Information About Nodal Current Densities) 2.8.22 ndcget Function (Getting a Nodal Current Density) 2.8.23 ndcput Subroutine (Storing a Nodal Current Density) 2.8.24 ndcdel Subroutine (Deleting a Nodal Current Density) 2.8.25 nvdiqr Function (Getting Information About Nodal Magnetic Virtual Displacements) 2.8.26 nvdget Function (Getting a Nodal Magnetic Virtual Displacement) 2.8.27 nvdput Subroutine (Storing a Nodal Virtual Displacement) 2.8.28 nvddel Subroutine (Deleting a Nodal Virtual Displacement) 2.9 Element Loading Routines 2.9.1 epriqr Function (Getting Information About Element Pressure/Convection) 2.9.2 eprget Function (Getting an Element Face Pressure)
2.9.3 eprput Subroutine (Storing an Element Face Pressure) 2.9.4 eprdel Subroutine (Deleting an Element Pressure/Convection) 2.9.5 ecviqr Function (Getting Information About Element Convections) 2.9.6 ecvget Function (Getting an Element Face Convection) 2.9.7 ecvput Subroutine (Storing an Element Face Convection) 2.9.8 ecvdel Subroutine (Deleting a Convection on an Element) 2.9.9 etpiqr Function (Getting Information About Element Temperatures) 2.9.10 etpget Function (Getting an Element Temperature) 2.9.11 etpput Subroutine (Storing an Element Temperature) 2.9.12 etpdel Subroutine (Deleting an Element Temperature) 2.9.13 ehgiqr Function (Getting Information About Element Heat Generation) 2.9.14 ehgget Function (Getting an Element Heat Generation) 2.9.15 ehgput Subroutine (Storing an Element Heat Generation) 2.9.16 ehgdel Subroutine (Deleting an Element Heat Generation) 2.9.17 efuiqr Function (Getting Information About Element Fluences) 2.9.18 efuget Function (Getting an Element Fluence) 2.9.19 efuput Subroutine (Storing an Element Fluence) 2.9.20 efudel Subroutine (Deleting an Element Fluence) 2.9.21 edciqr Function (Getting Information About Element Current Densities)
2.9.22 edcget Function (Getting Element Current Densities) 2.9.23 edcput Subroutine (Storing an Element Current Density) 2.9.24 edcdel Subroutine (Deleting an Element Current Density) 2.9.25 evdiqr Function (Getting Information About Element Virtual Displacements) 2.9.26 evdget Function (Getting an Element Virtual Displacement) 2.9.27 evdput Subroutine (Storing an Element Virtual Displacement) 2.9.28 eimiqr Function (Getting Information About Element Impedances) 2.9.29 eimget Function (Getting an Element Face Impedance) 2.9.30 eimput Subroutine (Storing an Element Impedance) 2.9.31 eimdel Subroutine (Deleting an Element Impedance) 2.9.32 esfiqr Function (Getting Information About Element Surface Stress Data) 2.9.33 esfget Function (Getting Element Surface Stress Data) 2.9.34 esfput Subroutine (Storing Element Surface Stress Data) 2.9.35 esfdel Subroutine (Deleting an Element's Surface Stress Data) 2.9.36 efsdel Subroutine (Deleting a Flagged Surface on an Element) 2.9.37 efsget function (Getting Element Face Flagged Surfaces) 2.9.38 efsiqr function (Getting Information About Flagged Surfaces) 2.9.39 efsput Subroutine (Storing an Element Face Flagged Surface)
2.10 Results Information Routines 2.10.1 dspiqr Function (Getting Information About Nodal Results) 2.10.2 dspget Function (Getting a Nodal Result from the Database) 2.10.3 dspput Subroutine (Storing a Constraint at a Node) 2.10.4 dspdel Subroutine (Deleting a Result at a Node) 2.10.5 emsiqr Function (Getting Information About an Element's Miscellaneous Summable Data) 2.10.6 emsget Function (Getting an Element's Miscellaneous Summable Data) 2.10.7 emsput Subroutine (Storing an Element's Miscellaneous Summable Data) 2.10.8 emsdel Subroutine (Deleting an Element's Miscellaneous Summable Data) 2.10.9 enfiqr Function (Getting Information About Element Nodal Forces) 2.10.10 enfget Function (Getting an Element's Nodal Forces) 2.10.11 enfput Subroutine (Storing an Element's Nodal Forces) 2.10.12 enfdel Subroutine (Deleting an Element's Nodal Forces) 2.10.13 ensiqr Function (Getting Information About an Element's Nodal Stresses) 2.10.14 ensget Function (Getting an Element's Nodal Stresses) 2.10.15 ensput Subroutine (Storing Nodal Stresses at an Element) 2.10.16 ensdel Subroutine (Deleting an Element's Nodal Stresses) 2.10.17 engiqr Function (Getting Information About an Element's Energies) 2.10.18 engget Function (Getting an Element's Energies)
2.10.19 engput Subroutine (Storing an Element's Energies and Volume) 2.10.20 engdel Subroutine (Deleting an Element's Energies) 2.10.21 egriqr Function (Getting Information About an Element's Nodal Gradients) 2.10.22 egrget Function (Getting an Element's Nodal Gradients) 2.10.23 egrput Subroutine (Storing an Element's Nodal Gradients) 2.10.24 egrdel Subroutine (Deleting an Element's Nodal Gradients) 2.10.25 eeliqr Function (Getting Information About an Element's Nodal Elastic Strains) 2.10.26 eelget Function (Getting an Element's Nodal Elastic Strains) 2.10.27 eelput Subroutine (Storing an Element's Nodal Elastic Strains) 2.10.28 eeldel Subroutine (Deleting an Element's Nodal Elastic Strains) 2.10.29 epliqr Function (Getting Information About an Element's Nodal Plastic Strains) 2.10.30 eplget Function (Getting an Element's Nodal Plastic Strains) 2.10.31 eplput Subroutine (Storing an Element's Nodal Plastic Strains) 2.10.32 epldel Subroutine (Deleting an Element's Nodal Plastic Strains) 2.10.33 ecriqr Function (Getting Information About an Element's Nodal Creep Strains) 2.10.34 ecrget Function (Getting an Element's Nodal Creep Strains) 2.10.35 ecrput Subroutine (Storing an Element's Nodal Creep Strains) 2.10.36 ecrdel Subroutine (Deleting an Element's Nodal
Creep Strains) 2.10.37 ethiqr Function (Getting Information About an Element's Nodal Thermal Strains) 2.10.38 ethget Function (Getting an Element's Nodal Thermal Stresses) 2.10.39 ethput Subroutine (Storing an Element's Nodal Thermal Stresses) 2.10.40 ethdel Subroutine (Deleting an Element's Thermal, Initial, and Swelling Strains) 2.10.41 euliqr Function (Getting Information About an Element's Euler Angles) 2.10.42 eulget Function (Getting an Element's Nodal Euler Angles) 2.10.43 eulput Subroutine (Storing an Element's Euler Angles) 2.10.44 euldel Subroutine (Deleting an Element's Euler Angles) 2.10.45 efxiqr Function (Getting Information About Element Fluxes) 2.10.46 efxget Function (Getting an Element Flux) 2.10.47 efxput Subroutine (Storing an Element's Fluxes) 2.10.48 efxdel Subroutine (Deleting Element Fluxes) 2.10.49 elfiqr Function (Getting Information About Element Local Forces) 2.10.50 elfget Function (Getting an Element Local Force) 2.10.51 elfput Subroutine (Storing an Element's Local Forces) 2.10.52 elfdel Subroutine (Deleting Element Local Forces) 2.10.53 emniqr Function (Getting Information About Element Miscellaneous Nonsummable Data)
2.10.54 emnget Function (Getting an Element's Miscellaneous Non-summable Data) 2.10.55 emnput Subroutine (Storing an Element's Miscellaneous Non-summable Data) 2.10.56 emndel Subroutine (Deleting an Element's Miscellaneous Non-summable Data) 2.10.57 ecdiqr Function (Getting Information About Element Current Densities) 2.10.58 ecdget Function (Getting an Element Current Density) 2.10.59 ecdput Subroutine (Storing an Element's Current Densities) 2.10.60 ecddel Subroutine (Deleting Element Current Densities) 2.10.61 enliqr Function (Getting Information About Element Nonlinear Tables) 2.10.62 enlget Function (Getting Element Nonlinear Tables) 2.10.63 enlput Subroutine (Storing an Element's Nonlinear Tables) 2.10.64 enldel Subroutine (Deleting Element Nonlinear Tables) 2.10.65 ehciqr Function (Getting Information About Calculated Element Heat Generations) 2.10.66 ehcget Function (Getting a Calculated Element Heat Generation) 2.10.67 ehcput Subroutine (Storing an Element's Calculated Heat Generations) 2.10.68 ehcdel Subroutine (Deleting Element Calculated Heat Generations)
3.2.1 dptoch Subroutine (Retrieve Eight Characters From a Double Precision Variable) 3.2.2 wrinqr Function (Obtain Information About Output) 3.2.3 erinqr Subroutine (Obtaining Information from the Errors Common) 3.2.4 TrackBegin Subroutine (Beginning Tracking for a Subroutine Call) 3.2.5 TrackEnd Subroutine (Ending Tracking for a Subroutine Call) 3.2.6 erhandler Subroutine (Displaying ANSYS Errors) 3.2.7 intrp Subroutine (Doing Single Interpolation) 3.2.8 tranx3 Subroutine (Processing Geometry for 3-D Line Elements) 3.2.9 systop Subroutine (Stopping an ANSYS Program Run) 3.3 Vector Functions 3.3.1 vdot Function (Computing the Dot Product of Two Vectors) 3.3.2 vsum Function (Summing Vector Components) 3.3.3 vmax Function (Retrieving the Maximum Vector Value at a Given Location) 3.3.4 lastv Function (Retrieving the Position of the Last Non-zero Term in a Double Precision Vector) 3.3.5 izero Function (Setting an Integer Vector to Zero) 3.3.6 imove Function (Assigning Equal Values to Two Integer Vectors) 3.3.7 vzero Subroutine (Initializing a Vector to Zero)
3.3.8 vmove Subroutine (Moving One Vector into Another) 3.3.9 vimove Subroutine (Moving One Vector into Another Incrementally) 3.3.10 vinit Subroutine (Assigning a Scalar Constant to a Vector) 3.3.11 viinit Subroutine (Assigning a Scalar Constant to a Vector Incrementally) 3.3.12 vapb Subroutine (Setting a Vector to Sum of Two Vectors) 3.3.13 vapb1 Subroutine (Combining Two Vectors in One) 3.3.14 vapcb1 Subroutine (Multiplying a Vector to a Constant) 3.3.15 vamb Subroutine (Gets a Third Vector by Subtracting One Vector from Another) 3.3.16 vamb1 Subroutine (Subtracting One Vector from Another) 3.3.17 vmult Subroutine (Multiplying a Vector by a Constant) 3.3.18 vmult1 Subroutine (Multiplying a Vector by a Constant) 3.3.19 vcross Subroutine (Defining a Vector via a Cross Product) 3.3.20 vnorme Subroutine (Normalizing a Three-Component Vector) 3.3.21 vnorm Subroutine (Normalizing a Vector to Unit Length) 3.3.22 ndgxyz Function (Getting the X,Y,Z Vector for a Node) 3.3.23 ndpxyz Subroutine (Storing X,Y,Z for a Node) 3.4 Matrix Subroutines 3.4.1 maxv Subroutine (Multiplying a Vector by a Matrix) 3.4.2 maxv1 Subroutine (Multiplying a Vector by a Matrix) 3.4.3 matxv Subroutine (Multiplying a Vector by a Full Transposed Matrix)
3.4.4 matxv1 Subroutine (Multiplying a Vector by a Full Transposed Matrix) 3.4.5 matxb Subroutine (Transposing a matrix) 3.4.6 maat Subroutine (Changing a Matrix Value via Addition, Multiplication, and Transposition) 3.4.7 matsym Subroutine (Filling the Lower Triangle from the Upper Triangle) 3.4.8 mctac Subroutine (Transposing a symmetric matrix) 3.4.9 tran Subroutine (Transposing a matrix) 3.4.10 symeqn Subroutine (Solving Simultaneous Linear Equations) 3.5 Message Processing Routines 3.5.1 msgdi Subroutine (Conditionally Printing Messages, Scalars, Vectors, or Matrices) 3.5.2 msgdic Subroutine (Conditionally Printing Messages and an Integer Vector) 3.5.3 msgdim Subroutine (Conditionally Printing Messages and Matrices) 3.5.4 msgdir Subroutine (Conditionally Printing Messages, Integers, and Reals) 3.5.5 msgdit Subroutine (Conditionally Printing Messages and a Transposed Integer Matrix) 3.5.6 msgdiv Subroutine (Conditionally Printing Messages and an Integer Vector) 3.5.7 msgdr Subroutine (Conditionally Printing Messages and Reals) 3.5.8 msgdrc Subroutine (Conditionally Printing Messages and Real Vectors) 3.5.9 msgdrm Subroutine (Conditionally Printing Messages and Real Matrices)
3.5.10 msgdrt Subroutine (Conditionally Printing Messages and Real Transposed Matrices) 3.5.11 msgdrv Subroutine (Conditionally Prints Messages and Real Vectors) 3.5.12 msgdt Subroutine (Conditionally Prints Message Text)
COMMAND
path/filename.ext
ARGUMENT
Argument
command,arg1,arg2
Note-
Information that supplements the main topic being discussed, such as important tips or guidelines. Actions or situations that could cause problems, unexpected ANSYS behavior, or unexpected results. Actions or situations that can shut down ANSYS, damage files, cause loss of data, etc.
Caution:
Warning:
This guide describes the format of the various binary data files that ANSYS creates, as well as routines supplied by ANSYS that allow you to retrieve data from these files. The chapter also discusses the CDWRITEcommand and the .cdbfile that it creates, as well as the format of the neutral graphics file. The entire set of programmer's guides can be accessed online as HTML files or downloaded (in either HTML or Postscript format) through the ANSYS documentation web site, http://www.ansys.com/Documentation/Manuals/872. A list containing the complete set of available ANSYS documentation is available at http://www.ansys.com/ServSupp/Library/library.html
G G G
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 for more information about external commands). If you link these subroutines into ANSYS, you are lilmited to 10 database access commands. Such commands, created through either method, operate at all levels of ANSYS operation, including the begin, preprocessor, general postprocessor, time-history postprocessor, and solution levels. For more information about accessing the ANSYS database, see Chapter 2. 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 1.7. 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 1.6. Several sets of UPFs enable you to define new elements and to adjust the nodal orientation matrix. See section 1.3 for more information. Another group of UPFs enables you to modify and monitor existing elements. For details, see section 1.5. You can customize UPF userop to create a custom design optimization routine. For more information, see section 1.12. You can call the ANSYS program as a subroutine in a program you've written. To learn how, see section 1.8.
G G
The ANSYS program. The UPF subroutines themselves. Study the UPF subroutines before customizing them, and make sure that you fully understand the subroutines, as well as any applicable functions. Unless you review them carefully, a few UPF subroutines may seem like a maze with many logic paths to consider. You may have to set special variables correctly in order to run your customized ANSYS program without errors. Even if you have in-depth knowledge of the ANSYS input and your desired outputs, you still need to ensure that everything that needs to be done in the UPF subroutines is done properly in your custom version. FORTRAN 77. Besides knowing how to write FORTRAN 77 subroutines, you must be sure that the level of the FORTRAN 77 compiler is as least as high as the level mentioned in your ANSYS installation manual. You also need to know what to do should the computer abort the program due to an arithmetic error, a file read error, a memory access error, and so on. The mathematics of the phenomenon you're planning to include.
Important
G
UPFs aren't available in certain data center environments or on some hardware configurations, such as machines using parallel processing for element formulation. 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're creating a customized, sitedependent version of the program. ANSYS, Inc. considers the use of UPFs a non-standard use of the program, one that the ANSYS Quality Assurance verification testing program doesn't cover. Therefore, you're responsible for verifying that the results produced are accurate and that your customizations don't adversely affect other, standard 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 non-standard uses of the ANSYS program, see Chapter 6 of the ANSYS Advanced Analysis Techniques Guide.
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't program a user element that has more than 32 degrees of freedom per node or more than 20 nodes per element.
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're 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 /ansys55/customize/user. If you're running the ANSYS program under Windows NT or Windows 95, the UPF source code resides in directory \ansys55\custom\user\intel.
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 don't want and make appropriate changes to the others.
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.
ansysdef.inc
Defines general ANSYS parameters. You must include this common to retrieve the parameter values of HEAP_INTEGER, HEAP_DOUBLE, HEAP_COMPLEX, or HEAP_REAL. Contains optimization variables Defines parameters for element characteristics Defines element characteristics (comments only) Contains element-specific information Defines pointers for the element data array Defines the element degree-of-freedom pointers Element type data
impcom.inc Used by all routines and functions in the ANSYS program outpcm.inc soptcm.inc stack.inc stepcm.inc usvrcm.inc Defines output control information Contains solution options and keys Defines stack storage. You must include this common in any routines that access stack space. Contains load step information Defines storage of user-defined variables
Link your routines into shared libraries (as discussed starting in Appendix A). Compile and link your custom routines into the ANSYS program itself. This is discussed for UNIX systems in 1.1.9 and for Windows systems in 1.1.10. You may need super-user or root privileges to run the procedure that does the linking.
The ANSCUSTOM procedure 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 /ansys55/customize/user/platform (where platform is a directory that uniquely identifies the hardware platform version). The new executable file created will be named ansys.e55t and will reside in the current directory. FORTRAN files are assumed to be FORTRAN 77 (some extensions are allowed), and C files are assumed to be ANSI C.
Chapter 1 of the ANSYS Installation and Configuration Guide for UNIX lists the compilers you'll need to use UPFs.
Issuing the USRCAL command Choosing menu path Main Menu>Preprocessor>Loads>-Load Step Opts->Other>User Routines or Main Menu>Solution>Load Step Opts->Other>User Routines.
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 ANSYS Commands Reference. If you don't 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.
procedure/executable resides in the ansys55\bin\platform directory. When run, the procedure searches the current working directory for the custom ANSYS executable (either ansys.e55t or ansys.exe, depending on your platform). If the custom ANSYS executable resides in a separate directory, you can specify the path on the ansys55cust command line, as follows: ansys55cust -custom /pathname/ansys.e55t or, for Windows ansys55cust -custom /pathname/ansys.exe
Issue the command using this format: /DEBUG,-1,F1,F2,F3,F4,F5,F6,F7,F8,F9 For This Argument Choose One of These Values F1 1 (provides basic solution control debugging) 1 (provides transient debugging using Newmark constants) F2 2 (provides transient debugging using velocities and accelerations) 1 (provides element matrix debugging and prints matrix + load vectors) F3 2 (provides element matrix debugging with load vectors only) 3 (provides element matrix debugging with matrix diagonals and load vectors) F4 F5 F6 1 (provides auto time stepping debugging) 1 (provides multifield debugging) 1 (provides arc-length debugging) 1 (provides basic Newton-Raphson debugging) F7 2 (provides Newton-Raphson debugging and prints out-of-balance forces or incremental displacement or each DOF) 3 (provides Newton-Raphson debugging and prints applied loads and n-r restoring force for each DOF) 1,2 (provides displacement vector debugging with displacement pointers) F8 2 (provides displacement vector debugging with incremental displacement) 3 (provides displacement vector debugging with contact database) F9 1 (provides temporary programmer debugging)
1.1.14.2.2 Element Debug Format Issue the command using this format: /DEBUG,-3,G1,G2,G3,G4,G5,G6,G7,G8,G9 For This Argument Choose One of These Values G1 G2 1 (provides basic element pass debugging) 1 (provides element displacement and coordinate debugging)
1 (provides element matrix debugging and prints matrix + load vectors) G3 2 (provides element matrix debugging with load vectors only) 3 (provides element matrix debugging with matrix diagonals and load vectors) G4 G5 G6 1 (provides element load information debugging) 1 (provides element real constant debugging) 1 (provides element saved variable debugging) 1 (provides element material property debugging with linear material properties) G7 2 (provides element material property debugging with nonlinear properties) 1,2 (provides element nonlinear debugging with plasticity) G8 2 (provides element nonlinear debugging with large deformation) 3 (provides element nonlinear debugging with contact database) G9 1 (provides temporary programmer debugging)
1.1.14.2.3 General Debug Format Issue the command using this format: /DEBUG,H1,H2,,H4,H5 For This Argument Choose One of These Values 1 (provides file header record information) H1 2 (provides input line (character)) 3 (provides input line (decoded)) 1 (provides wavefront reordering and element checking debugging) H2 2 (provides meshing debugging) 1 (provides nodal coordinate system transformation debugging) H4 2 (provides displacement updating debugging) H5 1 (provides pre-element debugging, element characteristics debugging, and element field load debugging)
plasticity. Issue the /UCMD command to make a user routine into a custom command. For more information, see section 1.9 later in this chapter.
The EBLOCK command can indicate multiple element lines in the file. The value EBLOCK returns will either be 0 (if the command executes successfully), or a negative element number if an error occurs.
Ncoord is the number of coordinates defined for this node. The default for Ncoord is 3 and the maximum value is 6. The default coordinate values are the X, Y, and Z coordinates, and the other values are THXY, THYZ, and THZX. Normally, you specify one NBLOCK command for each line of nodal data. The value NBLOCK returns will be either 0 (if the command executes successfully) or a negative node number if an error occurs.
Argument type is one of the following: 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
2-D or 3-D geometry Degree-of-freedom set Symmetric or unsymmetric matrix Number of nodes
G G G G G G
Number of body loads (for example, temperatures) Number of surface loads (for example, pressures) Number of real constants Number of variables to be saved Number of rows in element matrices Linear or nonlinear element.
Routines uel100 through uel105 calculate the element matrices (stiffness, specific heat, etc.), the element load vector (force, heat flow, etc.), 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:
G
G G
Routines uep100 through uep105 provide printed output of line elements. The general ANSYS postprocessor, 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.
external erhandler #include "echprm.inc" c external nminfo,erinqr integer erinqr integer ielc(*),i,kerr character*28 elcdn c C c *** ansys(r) copyright(c) 1971,78,82,83,85,87,89,92,94-97 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 see include deck elccmt for details 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 see include deck elccmt for details 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
The input and output arguments for subroutines uec101, uec102, uec103, uec104, and uec105 is identical to the uec100 subroutine listed above.
1.3.5 Subroutine uel100 (Computing Element Matrices, Load Vectors, and Results)
subroutine uel100 (elem,ielc,elmdat,eomask,nodes,locsvr,kelreq, x kelfil,nr,xyz,u,kelout,zs,zass,damp,gstif,zsc,zscnr,elvol,elmass, x center,elener,edindx,lcerst) --- general lumped mass is demonstrated -------------------------------*** primary function: 1. compute element matrices, load vectors, and results *** secondary functions: 2. maintain element solution data
c c c c c
c c *** user programmable functions may not be used in parallel processing *** c c *** Notice - This file contains ANSYS Confidential information *** c c *** ansys(r) copyright(c) 1971,78,82,83,85,87,89,92,94-97 c *** ansys, inc. c c input arguments: c elem (int,sc,in) - element label (number) c ielc (int,ar(IELCSZ),in) - array of element type characteristics c (IELCSZ = array size, defined in echprm) c elmdat (int,ar(10),in) - array of element data c eomask (int,sc,in) - bit pattern for element output c (see outpcm) c nodes (int,ar(nnod),in) - array of element node numbers c (nnod = number of nodes; 1 in this case) c locsvr (int,sc,in) - location of the saved variables c on file .esav for this element c kelreq (int,ar(10),in) - matrix and load vector form requests c (indices for kelreq are given with output c arguments below) c kelfil (int,ar(10),in) - keys indicating incoming matrices and c load vectors (indices for kelfil are the c same as given for kelreq with output c arguments below) c nr (int,sc,in) - matrix and load vector size c xyz (dp,ar(6,nnod),in) - nodal coordinates (orig) and rotation angle c u (dp,ar(nr,5),in) - element nodal solution values c 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 edindx (int,ar(20),out) - element result data file indexes c lcerst (int,sc,inout) - position on result file c
c *** primary function: produce printed output for user elements c used typically only for line elements c c *** ansys(r) copyright(c) 1971,78,82,83,85,87,89,92,94-97 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 ielc (int,ar(150),in) - element characteristics 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 c ept (dp,ar(*),in) - element pseudo-node temperatures c kemn (int,sc,in) - key to print misc. non-summed data c emn (dp,ar(*),in) - misc. non-summable data record c kems (int,sc,in) - key to print mmisc. summed data c ems (dp,ar(*),in) - misc. summed data c kens (int,sc,in) - key to print nodal stresses c ens (dp,ar(*),in) - nodal sresses at an element c keel (int,sc,in) - key to print nodal elastic strain c eel (dp,ar(*),in) - element nodal elastic strains c keth (int,sc,in) - key to print thermal,initial, and c swelling strains c eth (dp,ar(*),in) - nodal thermal strains at an element c kenl (int,sc,in) - key set if any nonlinear materials present c enl (dp,ar(*),in) - element nonlinear table c kepl (int,sc,in) - key to print nodal plastic strains c epl (dp,ar(*),in) - nodal plastic strains c kecr (int,sc,in) - key to print nodal creep strains c ecr (dp,ar(*),in) - nodal creep strains c c output arguments: c none
c c c c c c c c c c c
output arguments: variable (typ,siz,intent) description tr (dp,ar(32,32),inout) - nodal to global orientation matrix tr is a matrix that is already defined based on the degrees of freedom selected. it does not normally need to be changed. it may be printed out here to study. its functional size is nr by nr, where nr is the number of degrees of freedom in the element
c c c c c c c c c c c c c c c c c c c
*** -------------
*** ansys(r) copyright(c) 1971,78,82,83,85,87,89,92,94-97 *** ansys, inc. *** Notice - This file contains ANSYS Confidential information *** input arguments: variable (typ,siz,intent) elem (int,sc,in) output arguments: none
nsvr
(int,sc,inout)
- index for svr for this element (see svgidx) - the set number in this index = 1 - structural svrs = 2 - thermal/electric/fluid svrs = 3 - magnetic svrs = 4 - nonlinear svrs = 5 - plasticity svrs = 6 - creep svrs = 7 - coupled svrs = 8 - user svrs - number of dp words expected in this set
c c c c c c
leng svr
(int,sc,in) (dp,ar(leng),in)
1.4.5 Subroutine svpidx (Writing the Saved Variable Element Index to a File)
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 c *** Notice - This file contains ANSYS Confidential information *** c c input arguments: c variable (typ,siz,intent) description c locsvr (int,sc,inout) - pointer to start of svr for element c svindx (int,ar(10),in) - index to svr for this element c c output arguments: c locsvr (int,sc,inout) - pointer to start of svr for next element c
c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c
kpheno
(int,sc,in)
kprop
(int,sc,in)
= =
(int,sc,in) (dp,ar(nprop),in) (dp,ar(nprop),inout)(int,sc,in) 0 - real constants are used by this element, and the old values(rvro) have been saved; or the element does not use real constants. Any change of real constants causes all matrices to be reformed. 1 - real constants are used by this element and the old values(rvro) have been saved. However, any change of real constants will cause the run to terminate, because the results would be too unpredictable. (e.g. gap elements) 2 - element is nonlinear, so do not bother to check 3 - real constants are used by this element, and the old values(rvro) have been saved. However, no checking is done in this routine because of needed customized logic. 4 - real constants are used by this element, but the old values(rvro) have not been saved because it was decided not to use this much storage. therefore, no check can be made to determine if matrices should be reformed. (e.g. 100 layer elements) 5 - real constants are used by this element, but the old values(rvro) have not been saved because the real constants have no effect on matrix formulation. (e.g. acoustic elements) (dp,ar(*),in) - current real constants (dp,ar(*),inout) - previous real constants (dp,sc,inout) - previous value of mode (dp,sc,inout) - previous value of isym
changed in this routine(for analyzer). i = 0 must be used in calling routine if kpheno = 1. key for type of phenomenon/level of check 0 - structural like old sfrm1n,1s,3n,3s,fl 1 - thermal like old sfrm1c,1t,2t,3t 2 - electrical/magnetic like some of old sfrmpo 3 - general like old sfrmoo key indicating which material properties in the prop vector that need to be checked (see below) number of properties current mat props previous material properties
output arguments: propo (dp,ar(nprop),inout)rvro (dp,ar(*),inout) amodo (dp,sc,inout) asymo (dp,sc,inout) kelin (int,ar(10),out) -
current material properties current real constants current value of mode current value of isym keys indicating matrices to form
1.4.7 Subroutine subrd (Reading Element Load Data for a Substructure Generation Run)
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 c *** Notice - This file contains ANSYS Confidential information *** c c input arguments:
c c c c c c c c c c c c c c c c c c c c c c c c c
iel key
(int,sc,in) (int,sc,in)
nd
(int,sc,in)
- element number - type of load data = 1 temperature = 2 fluences = 3 heat generation rates = 4 current densities =10 pressures =11 film coefficients =12 bulk temperatures =13 extra displacement shapes =14 thermal strains(eptho in el42) =15 thermal flux (as in el55) =16 initial strains(epino in el01) =17 magnetic virtual displacements =18 calculated source field(hsn in el96) =20 element load vector =30 copy - do not scale(tempev in el42) first load step only - number of data items
- array of load data - load activation key = 0 no load for this data = 1 load is active
1.4.8 Subroutine subwrt (Writing an Element Load Vector to a File for a Substructure Generation Run)
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 c *** Notice - This file contains ANSYS Confidential information *** c 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 c c output arguments: none
c integer lp(3) c data lp /1,10,13/ c call propev (elem,mat,lp(1),tem,prop(1),3) c c *** Notice - This file contains ANSYS Confidential information *** c c c c c c c c c c c c c c c c c c c input arguments: iel (int,sc,in) mtr (int,sc,in) lp (int,ar(n),in)
- element number - material number(input quantity mat, mat comma - keys for which specific value is requested each group must be in ascending order (ex,ey,ez, etc) if negative, a required property if zero, leave prop term unchanged EX = 1, EY = 2, EZ = 3, NUXY= 4, NUYZ= 5, NUXZ= 6, GXY = 7, GYZ = 8 GXZ = 9, ALPX=10, ALPY=11, ALPZ=12, DENS=13, MU =14, DAMP=15, KXX =16 KYY =17, KZZ =18, RSVX=19, RSVY=20, RSVZ=21, C =22, HF =23, VISC=24 EMIS=25, ENTH=26, LSST=27, PRXY=28, PRYZ=29, PRXZ=30, MURX=31, MURY=32 MURZ=33, PERX=34, PERY=35, PERZ=36, MGXX=37, MGYY=38, MGZZ=39, EGXX=40 EGYY=41, EGZZ=42, TGXX=43, TGYY=44, TGZZ=45, SONC=46, (see chapter 2 of the elements volume of the user's manual for a detailed description)) (dp,sc,in) (int,sc,in) - temperature at which to evaluate material - number of properties to be evaluated.
tem n
c c c c c c
1.4.12 Subroutine pstevl (Evaluating EX, NUXY, GXY, ALPX, and DENS at Element Temperature)
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
1.4.13 Function gtplop (Retrieving the Start Point for Plastic Data)
function gtplop (mat,plopt) c *** primary function: get the plasticity option c *** secondary function: return the virtual starting address for the data c (see nlpropcheck for similar logic) c
c *** Notice - This file contains ANSYS Confidential information *** c c input arguments: c mat (int,sc,in) - material reference number c c output arguments: c plopt (int,sc,out) - plasticity option: c 1 bkin c 2 mkin c 3 miso c 4 biso c 5 aniso c 6 dp c 7 anand c 12 melas c 100 user c gtplop (int,sc,out) - virtual starting position of the data c
1.4.14 Function gtcrop (Retrieving the Start Position for Creep Data)
function gtcrop (mat,cropt) c *** primary function: get the creep options c *** secondary function: return the virtual starting address for the data c (see nlpropcheck for similar logic) c c *** Notice - This file contains ANSYS Confidential information *** c c input arguments: c mat (int,sc,in) - material reference number c c output arguments: c cropt (int,sc,out) - creep option: c 10000*(irrad+1) + 1000*(secondary+1) + c (primary+1) c where: c primary - primary creep (constant C6) c secondary - secondary creep (constant C12) c irrad - irradation induced (constant C66) c see creep table documentation c (TB command) c gtcrop (int,sc,out) - virtual starting position of the data c
1.4.15 Function gtswop (Retrieving the Start Position for Swelling Data)
function gtswop (mat,swopt) c *** primary function: get the swelling option c *** secondary function: return the virtual starting address for the data c (see nlpropcheck for similar logic) c c *** Notice - This file contains ANSYS Confidential information *** c c input arguments: c mat (int,sc,in) - material reference number c c output arguments: c swopt (int,sc,out) - swelling option: c 10000*(irrad+1) + 1000*(secondary+1) + c (primary+1)
c c c c c c
gtswop
(int,sc,out)
where: primary - primary swelling (constant C6) secondary - secondary swelling (constant C12) irrad - irradation induced (constant C66) see swelling table documentation (TB command) - virtual starting position of the data
c c
c c c c
description - number of user output items in array udbdat - user output items to be placed at the end of the nmisc record
value
(dp,ar(nval),in)
element number element data type (see elparm) pointer to results file position index to results file data the total number of values if edtype = EDEMS, this should -always- be ielc(nmsmis), unless there is a variable number, as in the layered shell elements. - output values (real)
1.4.23 Subroutine eldwrn (Writing Element Nonsummable Miscellaneous Data to the Results File)
subroutine eldwrn (elem,ielc,lcerst,edindx,nudb,udbdat,nval,value, x ndval) c *** primary function: output element nonsummable miscellaneous data c to result file c *** Notice - This file contains ANSYS Confidential information *** c c c c c c c c c c c c c c c c input arguments: elem (int,sc,in) - element number ielc (int,ar(IELCSZ),in) - element characteristic vector defined in elccmt lcerst (int,sc,inout) - pointer to results file position edindx (int,ar(25),inout)- index to results file data nudb (in,sc,in) - size of what the user wants to add udbdat (dp,ar(*),in) - what the user wants to add nval (int,sc,in) - the total number of values to be output(does not include nudb) this should -always- be ielc(NMNMIS), unless there is a variable number, as in the layered shell elements. value (dp,ar(ndval),in) - output values ndval (int,sc,in) - dimension of value - must be no less than ielc(NMNMIS) + ielc(NMNMUP)
c c c c
- rotation vector
c c c c
v2 = cos(v2/2) + 1/2*w2, w2 = 2*sin(v2/2)*e2 v21 = v2*v1 = cos(v21/2) + 1/2*w21 (quarternion multiplication) w1 =: v21 (w1 is updated)
x hc,tb,endhc,endtb,iexist) c primary function: define the current convection 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 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 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) c or deleted convection c requires new element matrix c
Elements
The next few pages describe the user routines you use to modify or monitor existing ANSYS elements. These routines enable you to perform tasks including:
G G G G G
Computing load vectors for frequency domain logic Storing element output that users supply Modifying the orientation of material properties and stresses Modifying the orientation of material properties and stresses of layers within an element Performing a user-defined operation on a parameter for the COMBIN7 and COMBIN37 elements. Providing a user-defined initial thickness for SHELL181. Providing a user-defined initial strain for SHELL181. Providing a user-defined fictive temperature relationship for VISCO88 and VISCO99. Provides visco-elastic computation in the stiffness pass for VISCO88 and VISCO99.
G G
G G
1.5.1 Subroutine userfd (Computing the Complex Load Vector for Frequency Domain Logic)
subroutine userfd (nr,kpeak,kcbrm,kpfor,ktrsur,isur, x cd,cm,ct,cb,do,doext,aread,alenv,nuxy,faclen,conac,fluidt,visc, x dprtem,watmot,xyzup,tr,accel,puvel,u,zass, x forl,zsc,zsc2,pdyn,holdwv) c *** primary function: compute complex load vector for frequency domain logic c *** secondary functions: none c -- accessed with keyopt(12) = 2 c c *** ansys(r) copyright(c) 1971,78,82,83,85,87,89,92,94-97 c *** ansys, inc. c *** Notice - This file contains ANSYS Confidential information *** c c input arguments: c nr (int,sc,in) - matrix size c kpeak (int,sc,in) - keyopt for wave combinations c kcbrm (int,sc,in) - key for reduced matrices/cable option c kpfor (int,sc,in) - keyopt for wave printout c ktrsur (int,sc,in) - keyopt for surface treatment(unfinished) c isur (int,sc,in) - surface flag c cd (dp,sc,in) - normal drag coefficient (real constant) c cm (dp,sc,in) - inertial coefficient (real constant) c ct (dp,sc,in) - tangential drag coefficient (real constant) 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 nuxy (dp,sc,in) - poisson'S RATIO 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 dprtem (int,sc,in) - size of water motion table c watmot (dp,ar(1278),in) - water motion 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 c c c c c c c c c c
(dp,ar(12),inout) - force vector in element coordinates (dp,ar(nr),inout) - real load vector for frequency domain (dp,ar(nr),inout) - complex load vector for frequency domain
output arguments: forl (dp,ar(12),inout) zsc (dp,ar(nr),inout) zsc2 (dp,ar(nr),inout) pdyn (dp,ar(2),out) holdwv (dp,ar(60),out)
force vector in element coordinates real load vector for frequency domain complex load vector for frequency domain dynamic pressure wave information held for printout
c c c c c c c c c c c c c c
current sub step time increment length of dof solution vector utot solution vector size of user output array (3 x nnode)
udbdat
(dp,ar(maxdat),out)
description - number of user output items in array udbdat (maximum size of numdat is ielc(NMNMUP) which is usually three times the number of nodes. - user output items to be placed at the end of the nmisc record
1.5.4 Subroutine usanly (Modifying Orientation of Material Properties and Stresses of Layers)
subroutine usanly c c c c c c c c (vn,vref,elem,thick,xyzctr,ln,bsangl) user written routine to modify orientation of material properties and stresses of layers within an element ************************** applicable to shell91,99, and solid46 accessed with keyopt(4) *** ansys(r) copyright(c) 1971,78,82,83,85,87,89,92,94-97 *** 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 c use 3 angles for 3-d solids c c the programmer of usanly can base their logic on the location c of the point in space, or an element attributes, such as thick c
1.5.5 Subroutine userrc (Performing User Operations on COMBIN7 and COMBIN37 Parameters)
c c c c *** ansys(r) copyright(c) 1971,78,82,83,85,87,89,92,94-97 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 subroutine userrc (elem,ireal,type,nusvr,usvr,parm,parmld, x c1,c2,c3,c4,fcon) primary function: user operation on parameter for combin7 and combin37 accessed with keyopt(9) = 1
c c
c *** Notice - This file contains ANSYS Confidential information *** c c c c c c c c c c c c c c *** ansys(r) copyright(c) 1971,78,82,83,85,87,89,92,94-97 *** ansys, inc. typ=int,dp,log,chr,dcp input arguments: variable (typ,siz,intent) prs (dp,ar(5),in) rvrp (dp,ar(11),in) angle (dp,sc,in) ex (dp,sc,in) nuxy (dp,sc,in) output arguments: variable (typ,siz,intent) userpe (dp,sc,out) siz=sc,ar(n) intent=in,out,inout
description pressure vector real constants(see elements manual) subtended angle Young's modulus Poisson's ratio
c primary function: c c c c c c c c c c c c c c c c c c
*** ansys(r) copyright(c) 1971,78,82,83,85,87,89,92,94-97 *** ansys, inc. typ=int,dp,log,chr,dcp siz=sc,ar(n) intent=in,out,inout
input arguments: variable (typ,siz,intent) description elem (int,sc,in) - User element number nr (int,sc,in) - number of rows in element matrix ls (int,ar(nr),in) - Dof Index vector for this element matrix zs (dp,ar(nr,nr,4),inout)- K,M,C,SS matrices for this element zsc (dp,ar(nr,2),inout) - Element load vector and N-R correction vec uelm (dp,ar(nr,5),in) - Nodal displacements for this element ielc (int,ar(150),in) - Element type characteristics nodes (int,ar(*),in) - Nodes for this element
c c c c c c c c c c
Dofs per node for this element Element data for this element X,Y,Z,THXY,THYZ,THZX for each element node Length of global displacement vector
output arguments: zs (dp,ar(nr,nr,4),inout)- K,M,C,SS matrices for this element zsc (dp,ar(nr,2),inout) - Element load vector and N-R correction vec WARNING: any CHANGES to these (or any other) arguments will have a direc impact on the solution, possibly giving meaningless results. The normal usage of this routine is simply monitor what is happening.
$ $ $ c c c c
CALL erhandler ('uthick', 5000, 2, 'ANSYS, Inc.-supplied version of UTHICK has been used. This works with the COMMENTED EXAMPLE input attached with uthick.F', 0.d0, ' ') --- linearly varying thickness for the cantilever model in the commented example; thick(x=0) = 0.1, thick(x=10) = 0.05 DO i=1,numDomIntPts thickness(i) = 0.1d0*(1.d0-curCoords(1,i)/20.d0) END DO
c 990 c RETURN END cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c C O M M E N T E D I N P U T F I L E T O B E U S E D W I T H c c T H E A N S Y S S U P P L I E D U T H I C K c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c!/batch,list c!/verify,ev181-57s c!/title,ev181-57s, Variable thickness shell with UTHICK c!/nolist c!/nopr c!/out,scratch c! c!/prep7 c! c!!!!!!! STANDARD USE OF SHELL 181 with Variable Thickness !!!!! c! c!*dim,thick,,10 c!thick(1) = 0.0975 c!thick(2) = 0.0925 c!thick(3) = 0.0875 c!thick(4) = 0.0825 c!thick(5) = 0.0775 c!thick(6) = 0.0725 c!thick(7) = 0.0675 c!thick(8) = 0.0625 c!thick(9) = 0.0575 c!thick(10)= 0.0525 c! c!*dim,lnodes,,11 c!*dim,unodes,,11 c! c!*do,i,1,11 c! x = (i-1)*1.0 c! n,i,x c! n,i+11,x,1.0 c! lnodes(i) = i c! unodes(i) = i+11 c!*enddo c! c!et,1,181 c!mp,ex,1,1000 c!mp,nuxy,1,0.3 c! c!*do,i,1,10 c! r,i,thick(i) CONTINUE
c! real,i c! e,lnodes(i),lnodes(i+1),unodes(i+1),unodes(i) c!*enddo c! c!!!!!!! USE OF SHELL 181 with Variable Thickness Through UTHICK !!!!! c! c!*dim,l2nod,,11 c!*dim,u2nod,,11 c!*do,i,1,11 c! x = (i-1)*1.0 c! n,i+22,x,2.0 c! n,i+33,x,3.0 c! l2nod(i) = i+22 c! u2nod(i) = i+33 c!*enddo c! c!et,2,181 c!keyopt,2,9,1 c!r,11 c!type,2 c!real,11 c! c!*do,i,1,10 c! e,l2nod(i),l2nod(i+1),u2nod(i+1),u2nod(i) c!*enddo c! c!/out c!elist c!etlist c!/out,scratch c! c!nsel,s,loc,x, c!d,all,ux c!d,all,uz c!d,all,rotx c!d,all,rotz c!d,all,roty c! c!nsel,s,loc,y c!d,all,uy c! c!nsel,s,loc,y,2.0 c!d,all,uy c! c!nsel,s,loc,x,10.0 c!f,all,my,0.004 c!alls c!fini c! c!/solu c!outres,all,all c!nlgeom,on c!solc,on c!nsubst,10,,5 c!eqslv,sparse c!solve c!fini c! c!/post1 c!set,last c!nsel,s,loc,x,10.0 c!/out c!/com
c!/com, ------------------------------------------------------c!/com, | Results of Node # 11 and 22 are from the standard use c!/com, | of SHELL181; the results of Node # 33 and 44 are c!/com, | obtained by using UTHICK (keyopt 9 = 1) and should c!/com, | match the results of node # 11 and 22 c!/com, ------------------------------------------------------c!/com c!prdi c!/out,scratch c!finish c! c!/delete,ev181-57s.emat c!/delete,ev181-57s.err c!/delete,ev181-57s.esav c!/delete,ev181-57s.osav c!/delete,ev181-57s.log c!/delete,ev181-57s.mntr c!/delete,ev181-57s.rst c!/delete,ev181-57s.full c!/golist c!/exit,nosave
| | | |
c iniData (dp,ar(numDirect+numShear),o) c user input stress values c ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c --- parameters c #include "impcom.inc" EXTERNAL erhandler c c --- argument list c INTEGER elemId, elemType, matId, curIntPt, curLayer, $ curSecPt, numDirect, numShear DOUBLE PRECISION curCoords(3), tLocation, basis(3,3), $ iniData(numDirect+numShear) c c --- local variables c INTEGER i,j,k DOUBLE PRECISION dummy (4,5,10) cc COMMON /dummyIniDat/ dummy,errFlag ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c --- B E G I N C O D I N G c c --- author of USTRESS.F should remove the data statement, error msgs c and any unnecessary flags. The data you define here does not c necessarily have to be done with data statement c DATA (((dummy(i,j,k),i=1,4),j=1,5),k=1,2) / $ -0.1200E+02, -0.1249E+01, 0.0000E+00, -0.4003E-04, $ -0.7202E+01, -0.7495E+00, 0.0000E+00, 0.4515E-04, $ 0.1924E-04, -0.6599E-03, 0.0000E+00, 0.1729E-03, $ 0.7202E+01, 0.7481E+00, 0.0000E+00, 0.3007E-03, $ 0.1200E+02, 0.1247E+01, 0.0000E+00, 0.3859E-03, $ -0.1200E+02, 0.3359E+00, 0.0000E+00, 0.1337E-02, $ -0.7201E+01, 0.2019E+00, 0.0000E+00, 0.7683E-03, $ 0.1732E-03, 0.8891E-03, 0.0000E+00, -0.8421E-04, $ 0.7201E+01, -0.2001E+00, 0.0000E+00, -0.9367E-03, $ 0.1200E+02, -0.3341E+00, 0.0000E+00, -0.1505E-02/ DATA (((dummy(i,j,k),i=1,4),j=1,5),k=3,4) / $ -0.1200E+02, -0.9424E-01, 0.0000E+00, -0.1560E-02, $ -0.7202E+01, -0.5653E-01, 0.0000E+00, -0.9405E-03, $ 0.4304E-03, 0.2657E-04, 0.0000E+00, -0.1124E-04, $ 0.7202E+01, 0.5659E-01, 0.0000E+00, 0.9180E-03, $ 0.1200E+02, 0.9429E-01, 0.0000E+00, 0.1537E-02, $ -0.1200E+02, 0.3043E-01, 0.0000E+00, 0.9459E-03, $ -0.7200E+01, 0.1827E-01, 0.0000E+00, 0.5991E-03, $ 0.6953E-03, 0.3727E-04, 0.0000E+00, 0.7890E-04, $ 0.7201E+01, -0.1820E-01, 0.0000E+00, -0.4413E-03, $ 0.1200E+02, -0.3036E-01, 0.0000E+00, -0.7882E-03/ DATA (((dummy(i,j,k),i=1,4),j=1,5),k=5,6) / $ -0.1200E+02, -0.1066E-01, 0.0000E+00, -0.4662E-03, $ -0.7200E+01, -0.6225E-02, 0.0000E+00, -0.3059E-03, $ 0.8873E-03, 0.4321E-03, 0.0000E+00, -0.6545E-04, $ 0.7201E+01, 0.7089E-02, 0.0000E+00, 0.1750E-03, $ 0.1200E+02, 0.1153E-01, 0.0000E+00, 0.3353E-03, $ -0.1200E+02, 0.4769E-02, 0.0000E+00, 0.2606E-03, $ -0.7197E+01, 0.2935E-02, 0.0000E+00, 0.1814E-03, $ 0.9262E-03, 0.1837E-03, 0.0000E+00, 0.6259E-04, $ 0.7199E+01, -0.2568E-02, 0.0000E+00, -0.5620E-04, $ 0.1200E+02, -0.4402E-02, 0.0000E+00, -0.1354E-03/ DATA (((dummy(i,j,k),i=1,4),j=1,5),k=7,8) /
$ $ $ $ $ $ $ $ $ $
-0.1199E+02, -0.2508E-02, 0.0000E+00, -0.7195E+01, -0.1396E-02, 0.0000E+00, 0.7471E-03, 0.2729E-03, 0.0000E+00, 0.7197E+01, 0.1941E-02, 0.0000E+00, 0.1199E+02, 0.3054E-02, 0.0000E+00, -0.1198E+02, 0.3654E-02, 0.0000E+00, -0.7191E+01, 0.2247E-02, 0.0000E+00, 0.2508E-03, 0.1354E-03, 0.0000E+00, 0.7191E+01, -0.1976E-02, 0.0000E+00, 0.1199E+02, -0.3383E-02, 0.0000E+00, DATA (((dummy(i,j,k),i=1,4),j=1,5),k=9,10) / $ -0.1198E+02, -0.4337E-02, 0.0000E+00, $ -0.7186E+01, -0.2616E-02, 0.0000E+00, $ -0.6408E-03, -0.3430E-04, 0.0000E+00, $ 0.7185E+01, 0.2547E-02, 0.0000E+00, $ 0.1198E+02, 0.4269E-02, 0.0000E+00, $ -0.1197E+02, -0.1326E-02, 0.0000E+00, $ -0.7181E+01, -0.8506E-03, 0.0000E+00, $ -0.1444E-02, -0.1371E-03, 0.0000E+00, $ 0.7178E+01, 0.5763E-03, 0.0000E+00, $ 0.1196E+02, 0.1052E-02, 0.0000E+00, c i = 0 j = 0 k = 0 c
-0.3990E-04, -0.3183E-04, -0.1972E-04, -0.7612E-05, 0.4584E-06, 0.2321E-03, 0.1487E-03, 0.2362E-04, -0.1015E-03, -0.1849E-03/ 0.2315E-03, 0.1461E-03, 0.1810E-04, -0.1099E-03, -0.1953E-03, 0.7206E-03, 0.4404E-03, 0.2012E-04, -0.4002E-03, -0.6803E-03/
IF (curIntPt.EQ.1 .AND. curLayer.EQ.1 .AND. curSecPt.EQ.1) THEN CALL erhandler ('ustress', 5000, 2, 'ANSYS, Inc.-supplied $ version of USTRESS has been used. This $ works with the COMMENTED EXAMPLE input $ attached with ustress.F', 0.d0, ' ') END IF c iniData(1) iniData(2) iniData(3) iniData(4) c 990 c RETURN END ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c C O M M E N T E D I N P U T F I L E T O B E U S E D W I T H c c T H E A N S Y S S U P P L I E D U S T R E S S c ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c!/batch,list c!/PREP7 c! c!et,1,181 c!keyopt,1,10,1 c!r,1,1.0 c! c!mp,ex,1,1000 c!mp,nuxy,1,0.3 c! c!NBLOCK,6,SOLID c!(3i8,6e16.9) c! 23 0 0 0.000000000E+00 c! 24 0 0 9.90525175 0.000000000E+00 -1.18849741 CONTINUE = = = = dummy(1,curSecPt,elemId) dummy(2,curSecPt,elemId) dummy(3,curSecPt,elemId) dummy(4,curSecPt,elemId)
c! 25 0 c! 26 0 c! 27 0 c! 28 0 c! 29 0 c! 30 0 c! 31 0 c! 32 0 c! 33 0 c! 34 0 c! 35 0 c! 36 0 c! 37 0 c! 38 0 c! 39 0 c! 40 0 c! 41 0 c! 42 0 c! 43 0 c! 44 0 c!N,R5.3,LOC, -1, c!N,R5.1,LOC, -1, c! c!EBLOCK,18,SOLID c!(18i7) c! 1 1 1 25 44 35 c! 1 1 1 26 43 44 c! 1 1 1 27 42 43 c! 1 1 1 28 41 42 c! 1 1 1 29 40 41 c! 1 1 1 30 39 40 c! 1 1 1 31 38 39 c! 1 1 1 32 37 38 c! 1 1 1 33 36 37 c! 1 1 1 24 34 36 c! -1 c!EN,R5.1,ATTR, -1, c! c!nsel,s,loc,x, c!d,all,ux c!d,all,uz c!d,all,rotx c!d,all,rotz c!d,all,roty c! c!nsel,s,loc,y c!d,all,uy c!nall c! c!fini c! c!/solu c!
0 0.999933795 0 1.99930664 0 2.99754302 0 3.99406599 0 4.98830170 0 5.97967935 0 6.96762690 0 7.95157929 0 8.93097304 0 9.90524927 0 0.000000000E+00 0 8.93097042 0 7.95157631 0 6.96762465 0 5.97967659 0 4.98830027 0 3.99406429 0 2.99754103 0 1.99930796 0 0.999931339
0.000000000E+00-1.162898000E-02 0.000000000E+00-4.697524623E-02 0.000000000E+00-0.106378219 0.000000000E+00-0.189702267 0.000000000E+00-0.296924624 0.000000000E+00-0.427972294 0.000000000E+00-0.582764249 0.000000000E+00-0.761199170 0.000000000E+00-0.963156159 1.00000034 -1.18850710 0.999997689 1.00000026 -0.963168610 1.00000006 -0.761213374 1.00000006 -0.582779590 1.00000004 -0.427988151 0.999999775 -0.296940984 1.00000056 -0.189719078 0.999999100 -0.106393013 1.00000069 -4.699745205E-02 1.00000098 -1.163438631E-02
1 2 3 4 5 6 7 8 9 10
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
4 4 4 4 4 4 4 4 4 4
0 0 0 0 0 0 0 0 0 0
23 25 26 27 28 29 30 31 32 33
c!nlgeom,on c!solcontrol,on c!nropt,full,,off c!lnsrch,off c!nsubst,1 c!outres,all,all c!cnvtol,f,,,,1.0e-4 c!cnvtol,m,,,,1.0e-4 c!eqslv,sparse c!solve c! c!/post1 c!set,last c!pres,s c!prdi ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c c c ***** notice- this routine contains ansys, inc. confidential information **** c c *** ansys(r) copyright(c) 1971,78,82,83,85,87,89,92,94-97 c *** ansys, inc. c c input arguments: c veinpt (dp,ar(95),in) - viscoelastic input data
c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c
(int,sc,in) (dp,sc,in) (dp,sc,in) (dp,sc,in) (dp,sc,in) (dp,ar(ncomp,ncomp),in) (dp,ar(ncomp,ncomp),in) (dp,ar(ncomp),in) (dp,ar(ncomp),in) (dp,sc,in)
number of components (4 or 6) temperature incremental temperature bulk modulus at infinite time shear modulus at infinite time material matrix for shear modulus material matrix for bulk modulus strain for previous iteration total strain for current iteration reference temperature
output arguments: eex (dp,sc,out) egxy (dp,sc,out) phil (dp,sc,inout) zil (dp,sc,inout) g1l (dp,ar(ncomp,10),out) g2l (dp,ar(ncomp,10),out) hsm (dp,ar(10),out) hbm (dp,ar(10),out) ftl (dp,sc,inout) dftl (dp,ar(10),out) tvc (dp,sc,inout) dvc (dp,sc,out) dsig (dp,ar(ncomp),out) rsig (dp,ar(ncomp),out) cm (dp,ar(ncomp,ncomp),out)kerr (int,sc,out) -
effective bulk modulus effective shear modulus previous shift factor previous pseudo time recursive shear relaxation recursive bulk relaxation recursive shear relaxation recursive bulk relaxation previous fictive temperature incremental fictive temperature total volume change incremental volume change stress change stress relaxation total material matrix error key
argument of convenience: cml (dp,ar(ncomp,ncomp),none)- no value (used only to avoid simplify logic due to variable array sizes)
Writing your own plasticity, creep, or swelling laws Updating the nonlinear strain history for a user-defined material Checking material data you've defined Computing the derivatives of the strain energy density "W" with respect to its invariants Controlling hygrothermal growth.
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). Don't use the "_MATL" string outside the scope of the MPREAD command.
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) 1971,78,82,83,85,87,89,92,94-97 c *** ansys, inc. c c input arguments: c variable (type,size,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 =0, 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 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 c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c
plwork
(dp,sc,inout)
output arguments: variable (type,size,intent) epel eppl statev usvr epeq plwork sigepl sigrat depeq
description
(dp,ar(ncomp),inout)- elastic strain (dp,ar(ncomp),inout)- updated plastic strain (dp,ar(ncomp,6),inout)- updated state variables (dp,ar(nuval,nintp),inout)- updated additional state variables (dp,sc,inout) (dp,sc,inout) (dp,sc,out) (dp,sc,out) (dp,sc,out) - updated effective plastic strain - updated accumulated plastic work - stress value on stress-strain curve at epeq - ratio of trial stress to yield stress - increment in plastic strain (equivalent) (used for auto time stepping - time step is reduced if it exceeds .05)
dt
fortran parameters (to be defined by the user): variable (type) description numinp (int) - number of data items in the user-defined data table (tbdat commands) nuval (int) - number of additional state variables per integration point nintp (int) - maximum number of integration points of an element to be used with this routine (14 is the maximum) note: nuval x nintp = nstv(on nsvr command); cannot exceed 840! internal variables: variable (type,size) b (dp,ar(6,6)) c (dp,ar(6,12)) con (dp,sc) deppl (dp,ar(6)) dfds (dp,ar(6)) dlamb (dp,sc) ep (dp,ar(6)) epshfo (dp,ar(6)) epshft (dp,ar(6)) et (dp,sc) h (dp,sc) n2 (int,sc) seqtr (dp,sc) sigtr (dp,ar(6)) sigy (dp,sc) vect (dp,ar(6))
description - 2nd derivative of the yield function - part of deff - temporary variable - plastic strain increment - derivative of the yield function (normal) - plastic multiplier - shifted strain - initial shift strain (center of the yield surf) - shift strain (center of the yield surface) - tangent modulus (stress/total strain) - plastic tangent modulus (stress/plastic strain) - ncomp squared, ncomp*ncomp - equivalent (von mises) trial stress - trial stress - yield stress - temporary vector
c c *** Notice - This file contains ANSYS Confidential information *** c c c *** ansys(r) copyright(c) 1971,78,82,83,85,87,89,92,94-97 c *** ansys, inc. c c input arguments: c variable (type,size,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 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 c proptb (dp,ar(72),in) - material properties input on tb commands c c timval (dp,sc,in) - current time value c timinc (dp,sc,in) - time 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 toffst (dp,sc,in) - temperature offset from absolute zero c fluen (dp,sc,in) - fluence at the end of this substep c dfluen (dp,sc,in) - fluence increment over this substep c c epel (dp,ar(ncomp),inout)- elastic strain c epcrp (dp,ar(ncomp),inout)- creep strain from previous substep c statev (dp,ar(ncomp*5+2),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 c output arguments: c variable (type,size,intent) description c 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(nuval,nintp),inout)- updated additional state variables c delcr (dp,sc,out) - equivalent creep strain increment (used c for creep ratio calculation) c c fortran parameters (to be defined by the user): c variable (type) description 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 c c c c c c c c c
internal variables: variable (type,size) con (dp,sc) del (dp,ar(6)) epet (dp,sc) ept (dp,ar(6)) eptot (dp,sc) sigen (dp,sc) temabs (dp,sc)
description - temporary variable - creep strain increments - equivalent elastic strain (before creep) - total strain - equivalent total strain, elastic + creep - equivalent stress (before creep) - temperature on the absolute scale
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 *** ansys(r) copyright(c) 1971,78,82,83,85,87,89,92,94-97 c *** ansys, inc. c c input arguments: c variable (type,size,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,size,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 c stri (dp,ar(3,3),inout) - updated stress c
c c c c c c c c c c c c c c c c c
- effective inelastic deformation rate - scalar linearization modulus (see below) - radial return factor (see below) - direction of plastic flow
fortran parameters (to be defined by the author): variable (type) description numinp (int) - number of data items in the user-defined data table (tbdat commands) nuval (int) - number of additional state variables per integration point nintp (int) - maximum number of integration points of an element to be used with this routine (8 is the maximum) note: nuval x nintp cannot exceed 840!
1.6.6 Subroutine usrmooeny (Computing Derivatives of Strain Energy Density with Respect to Invariants)
subroutine usrmooney (mat,xnu,xiii,ndf,wi,wij,wini,pi,pij,prs,bm) c c *** primary function: c c this is a user subroutine to compute the derivatives of the c strain energy density 'W' with respect to its invariants. c the user can modify this subroutine in order to incorporate c their own material law. c accessed with keyopt(7) = 1 and tb,mooney c c *** Notice - This file contains ANSYS Confidential information *** c c *** ansys(r) copyright(c) 1971,78,82,83,85,87,89,92,94-97 c *** ansys, inc. c c *** comments: c c by definition, a material is said to be hyperelastic, if there c exists a strain energy density function, which is a scalar c function of one of the strain or deformation tensors, whose
c derivative with respect to a strain component determines the c corresponding stress component. c c these strain energy density functions are functions of c invariants of strain tensors and a set of constants determined c in the laboratory tests. the user can specify their own form c of the strain energy density functions in terms of the invariants c of the cauchy-green tensors and a number of laboratory-determined c constants. c c in this subroutine the user is provided with (1) the invariants c 'XIII' of the cauchy-green strain tensor and (2) a flag 'NDF' c identifying the dimensionality of the problem. c c the subroutine first computes the distortion-only invariants c 'XJJJ'. the material constants that were specified by the user c through the 'TB' table are now put into local variables, e.g., c 'AI' and 'BI' in the mooney-rivlin example. the user then c defines the expression for the strain energy density function. c the term of 'W' involving 'BM' must remain intact; the c user will have their own expression for the first part of 'W', c e.g., terms involving constants 'AI' and 'BI' of the example of the c mooney-rivlin material. the expression for the distortion-based c pressure 'PRS' remains the same. 'PRS' along with 'BM' control c the degree of incompressibility of the material. c c the user will have to find the expressions for the derivatives c of 'W' (derivatives of 'PRS' remaining the same), i.e., 'WI' c and 'WIJ'. the subroutine returns the values of 'WINI', 'WI', c 'WIJ', 'PRS', 'PI', 'PIJ' and 'BM'. c c ---------------------------------------------------------------------c c input arguments: c xiii (dp,ar(3),in) - invariants of the cauchy-green tensor c mat (int,sc,in) - material reference number c xnu (dp,sc,in) - input possions ratio c ndf (int,sc,in) - dimensionality of the problem c (2 for plane strain) c (3 for 3d/axisymmetric) c c output arguments: c wi (dp,ar(3),out) - first derivatives of strain energy density c with respect to invariants c wij (dp,ar(3,3),out) - second derivatives of strain energy density c with respect to invariants c wini (dp,sc,out) - strain energy density c c pi (dp,ar(3),out) - first derivatives of pressure c with respect to invariants c pij (dp,ar(3,3),out) - second derivatives of pressure c with respect to invariants c prs (dp,sc,out) - pressure c bm (dp,sc,out) - bulk modulus c c ---------------------------------------------------------------------c c definitions : c -------------------------------------------c wi(1) = d(w)/d(xiii(1)) c wi(2) = d(w)/d(xiii(2)) c wi(3) = d(w)/d(xiii(3)) c
c c c c c c c c c c c c c c c c c c c c c
wij(1,1) = d**2(w)/d(xiii(1))*d(xiii(1)) wij(1,2) = d**2(w)/d(xiii(1))*d(xiii(2)) wij(1,3) = d**2(w)/d(xiii(1))*d(xiii(3)) wij(2,2) = d**2(w)/d(xiii(2))*d(xiii(2)) wij(2,3) = d**2(w)/d(xiii(2))*d(xiii(3)) wij(3,3) = d**2(w)/d(xiii(3))*d(xiii(3)) -------------------------------------------pi(1) = d(prs)/d(xiii(1)) pi(2) = d(prs)/d(xiii(2)) pi(3) = d(prs)/d(xiii(3)) pij(1,1) = d**2(prs)/d(xiii(1))*d(xiii(1)) pij(1,2) = d**2(prs)/d(xiii(1))*d(xiii(2)) pij(1,3) = d**2(prs)/d(xiii(1))*d(xiii(3)) pij(2,2) = d**2(prs)/d(xiii(2))*d(xiii(2)) pij(2,3) = d**2(prs)/d(xiii(2))*d(xiii(3)) pij(3,3) = d**2(prs)/d(xiii(3))*d(xiii(3)) --------------------------------------------
1.6.8 Subroutine usermu (Supplying a Friction Coefficient for CONTAC48 and CONTAC49)
subroutine usermu (elem,type,mat,area,gap,loc,fn,nusvr,usvr, x time,timinc,vel,temp,stat,oldst,prevst,oldmu,prevmu,mu) c c *** primary function: user supplied coefficient of friction c called only by contac48,49 c accessed by keyopt(9) > 0 c c *** Notice - This file contains ANSYS Confidential information *** c c c *** ansys(r) copyright(c) 1971,78,82,83,85,87,89,92,94-97
c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c
*** ansys, inc. input arguments: variable (typ,siz,intent) elem (int,sc,in) type (int,sc,in) mat (int,sc,in) area (dp,sc,in) gap loc (dp,sc,in) (dp,ar(2),in)
prevst
(int,sc,in)
stat
(int,sc,in)
oldmu prevmu
(dp,sc,in) (dp,sc,in)
description element number element type number material number element area (contac49) or length (contac48) - present gap or penetration - location of the contact node projected to the target surface - in dimensionless element coordinates - current contact force normal to the target plane - number of user-supplied element variables - user-supplied element variables - current time - current substep time increment - contact node velocity components in the target plane - average temperature - status of previous time step (3,4: open; 2: closed and sliding; (1: closed and stuck) - status of previous iteration (3,4: open; 2: closed and sliding; (1: closed and stuck) - current status (3,4: open; 2: closed and stickslide status undetermined) - friction coefficient used in the previous time step - friction coefficient used in the previous iteration -
c input arguments: c variable (typ,siz,intent) c elem (int,sc,in) c elim (dp,ar(9),in) c c slim (dp,ar(12),in) c c c eps (dp,ar(6),in) c sig (dp,ar(6),in) c tem (dp,sc,in) c matlay (int,sc,in) c iott (int,sc,in) c keyer (int,sc,in) c c output arguments: c variable (typ,siz,intent) c fc6 (dp,sc,out) c c #include "impcom.inc" external erhandler c
description - element number - failure strains at the current temperature (tbdata items 1-9) - failure stresses and coupling coefficients at the current temperature (tbdata items 10-21) - vector of strains - vector of stresses - temperature at this point in the model - material number - unit number for writing - error flag (0 = ok, 1 = error)
C C c c C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C
FLDA,COF3,VISC,value3 *** ansys(r) copyright(c) 1971,78,82,83,85,87,89,92,94-97 *** ansys, inc. input arguments: variable (typ,siz,intent) dudx (dp,sc,in) dudy (dp,sc,in) dudz (dp,sc,in) dvdx (dp,sc,in) dvdy (dp,sc,in) dvdz (dp,sc,in) dwdx (dp,sc,in) dwdy (dp,sc,in) dwdz (dp,sc,in) u (dp,sc,in) v (dp,sc,in) w (dp,sc,in) x (dp,sc,in) y (dp,sc,in) z (dp,sc,in) kGeom (int,sc,in) Vis (dp,sc,in) Temp (dp,sc,in) Tref (dp,sc,in) Pres (dp,sc,in) Pref (dp,sc,in) Cf (dp,ar(4),in) Mfrac (dp,ar(6),in) DfNSpec (int,sc,in) Time (dp,sc,in) output arguments: variable (typ,siz,intent) VisNew (dp,sc,out)
description velocity gradient component velocity gradient component velocity gradient component velocity gradient component velocity gradient component velocity gradient component velocity gradient component velocity gradient component velocity gradient component velocity component velocity component velocity component position component position component position component analysis type old viscosity temperature reference temperature pressure reference pressure input coefficients species mass fractions defined number of species time
c *** Notice - This file contains ANSYS Confidential information *** c c c c typ=int,dp,log,chr,dcp input arguments: variable (typ,siz,intent) kcomp (int,sc,in) siz=sc,ar(n) intent=in,out,inout
c c c c c
ep posn
(dp,ar(6),in) (dp,sc,in)
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 convection surfaces Changing information about element face convection surfaces Changing information about element face charge density surfaces.
Activate these routines by issuing the USRCAL command or by choosing an equivalent menu path.
c c c c c c c c c c c c c c c c
nd dat
(int,sc,in) - size of dat array (dp,ar(nd),inout) - array of data as normally computed by element as selected by key
output arguments: variable (typ,siz,intent) description dat (dp,ar(nd),inout) - array of data passed back to element this data represents values at the end of the load step the input argument dat may be used in one of three ways: 1. it may be simply passed thru 2. it may be used as a flag(e.g. if dat(1) = -3.0, use a certain set of logic) 3. it may be completely ignored and instead defined with new logic
c *** primary function: change element face convection surface info c c in order to activate this user programmable feature, c the user must enter the 'usrcal,usercv' command. c c *** ansys(r) copyright(c) 1998 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 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 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 c the input arguments hc and tb 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 hc(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 c c c c c c c c c c c c this routine is called during each substep of each load step. it is called for each equilibrium iteration. it is called once per element. it is called only during the heat flow load vector formulation stage, and not during the heat flow evaluation stage. the call to get the standard ansys input convection surfaces is made just before entering this routine, so this information is available to be modified, if desired. velocity-dependent film coefficients can be computed by inputting the velocity as the input film coefficient or bulk temperature or by inputting the velocity as a function of location in space. this routine could then compute the effective film coefficient.
1.7.4 Subroutine userfx (Changing Element Face Heat Flux Surface Information)
subroutine userfx (ielc,ielem,time,nr,u, ndat,dat) c *** primary function: change element face heat flux surface info
c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c
in order to activate this user programmable feature, the user must enter the usrcal command. this routine is called during each substep of each load step. it is called for each equilibrium iteration. it is called once per element. it is called only during the heat flow load vector formulation stage, and not during the heat flow evaluation stage. the call to get the standard ansys input heat flux surfaces is made just before entering this routine, so this information is available to be modified, if desired. *** ansys(r) copyright(c) 1971,78,82,83,85,87,89,92,94-97 *** ansys, inc. input arguments: variable (typ,siz,intent) ielc (int,ar(IELCSZ),in) ielem (int,sc,in) time (dp,sc,in) nr (int,sc,in) u ndat dat
description array of element type characteristics element number for operation. time of current substep number of nodal temperatures of the element (dp,ar(nr),in) - vector of most recent values of the temperatures (int,sc,in) - number of data points per element (dp,ar(ndat),inout) - fluxes (has input values for each corner of each face) -
output arguments: variable (typ,siz,intent) description dat (dp,ar(ndat),inout) - fluxes (defines input values for each corner of each face)
the input argument dat may be used in one of three ways: 1. they may be simply passed thru. 2. they may be used as a flag(e.g. if dat(2) = -3.0, use a certain set of logic). 3. they may be completely ignored. and instead redefined with new logic
1.7.5 Subroutine userch (Changing Element Face Charge Density Surface Information)
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 c c c c c c c c c c c c c c c c c c c c c c c c
*** ansys(r) copyright(c) 1971,78,82,83,85,87,89,92,94-97 *** ansys, inc. input arguments: variable (typ,siz,intent) ielc (int,ar(IELCSZ),in) ielem (int,sc,in) time (dp,sc,in) nr (int,sc,in) u ndat dat
description array of element type characteristics element number for operation. time of current substep number of nodal temperatures of the element (dp,ar(nr),in) - vector of most recent values of the temperatures (int,sc,in) - number of data points per element (dp,ar(ndat),inout) - fluxes -
output arguments: variable (typ,siz,intent) description dat (dp,ar(ndat),inout) - fluxes the input argument dat may be used in one of three ways: 1. they may be simply passed thru. 2. they may be used as a flag(e.g. if dat(2) = -3.0, use a certain set of logic). 3. they may be completely ignored. and instead redefined with new logic
c object/library: c current - acel c *** Notice - This file contains ANSYS Confidential information *** c *** ansys(r) copyright(c) 1971,78,82,83,85,87,89,92,94-97 c *** ansys, inc. c c c c c c c c c vc c c input arguments: key (int,sc,in)
- Key 0 1 2 3 4 5 -
to desired acceleration components Translational acceleration Angular Velocity Angular Acceleration Angular Velocity around C.G. Angular Acceleration arount C.G. C.G. Location in global coord. system
NOTE: elem
Only key=1 for spin softening is currently implemented (int,sc,in) - Element number
This section presents examples of how two of the load customization UPFs, the usercv subroutine and the useracel subroutine, can affect analysis results.
! flag to save values ! temp DOF, no midside nodes, has extra node ! flag for convection surface
Now, look at the results from this example analysis (shown below). Note that the FLOW RATE magnitude for FLUID66 matches the HFILM for SURF19.
***** uelEMENT SOLUTION ***** LOAD STEP= 2 SUBSTEP = uel= 1 NODES= 1 2 0.00000E+00 FLOW RATE= -4.4721 HT COND RATE= 128.60 0.00000E+00 HT TRANSP RATE= 0.00000E+00 FRICTION FACTOR= 0.100000E-01 0.00000E+00
1 0
CONV AREAS(I,J)=
0.00000E+00
HFILM=
0.00000E+00 0 FLUID66 HT CONV RATES(I,J)= 0.00000E+00 0 MAT= 1 PUMP HD= 0.00000E+00 RE=
uel= 2 NODES= 2 3 0.00000E+00 FLOW RATE= -4.4721 HT COND RATE= -80.801 0.00000E+00 HT TRANSP RATE= 0.00000E+00 FRICTION FACTOR= 0.100000E-01 0.00000E+00 HFILM= 0.00000E+00 uel= 3 NODES= 3 4 0.00000E+00 FLOW RATE= -4.4721 HT COND RATE= -80.801 0.00000E+00 HT TRANSP RATE= 0.00000E+00 FRICTION FACTOR= 0.100000E-01 0.00000E+00 HFILM= 0.00000E+00
CONV AREAS(I,J)=
0.00000E+00
0 FLUID66
0 MAT=
RE=
HT CONV RATES(I,J)=
0.00000E+00
CONV AREAS(I,J)=
0.00000E+00
*** WARNING *** CP= 0.800 TIME= 17:23:49 ANSYS,INC.-supplied version of coding for USERCV has been used. Using getvel66, the velocity from node 2 is 0.4472E+01 uel= VOLUME= 4 SURFACE NODES= 30.000 12 EXTRA NODE= 2 MAT= 1 AREA= 30.000 SURF19 HFILM= 4.4721 4.4721 TBULK= 10.299 10.299 CONV. HEAT RATE= -209.40 CONV. HEAT RATE/AREA= -6.9801 11
TAVG=
8.7381
*** WARNING *** CP= 0.800 TIME= 17:23:49 ANSYS,INC.-supplied version of coding for USERCV has been used. uel= 5 NODES= -0.2753 11 13 14 MAT= PLANE55 -0.6346 0.6917 12 1 VOL= 90.00 3.029 6.980
TG(X,Y,SUM)= 7.609 1
TF(X,Y,SUM)=
Two Dimensional model (plane42) component rotation FAST OMGFAST SLOW OMGSLOW external cmpcheck, parevl logical cmpcheck double precision parevl integer kerr double precision subc(3) data subc / 3*0.0d0 / if (key .eq. 1) then --- see if element is a member of component FAST: if (cmpcheck('FAST ',elem)) then vect(2) = parevl('OMGFAST ',0,subc(1),1,kerr) --- see if element is a member of component SLOW:
elseif (cmpcheck('SLOW ',elem)) then vect(2) = parevl('OMGSLOW ',0,subc(1),1,kerr) endif endif return end
The ANSYS input used for this model is as follows: /bat,list /title, demonstrate /prep7 et,1,42 /nopr mp,ex,,12e6 mp,dens,,.004 n,1 n,11,50 fill ngen,6,20,1,11,1,,3 e,1,2,22,21 egen,10,1,1 egen,3,40,all d,1,all,,,101,20 d,all,uy esel,s,elem,,11,20 cm,FAST,elem eall esel,s,elem,,21,30 cm,SLOW,elem eall omega,0,0,0,1 OMGFAST = 1000 OMGSLOW = 500 ! note that first 10 finish /solu /title, BASE CASE /title, DEMONSTRATE
use of useracel
! turn on spin softening ! define parameter for use in useracel ! define parameter for use in useracel elements will be stationary
Suppose that you ran this example problem using the standard ANSYS product. You'd receive the following output information: *** FREQUENCIES FROM BLOCK LANCZOS ITERATION *** MODE FREQUENCY (HERTZ) 1 287.3798632612 2 287.3798632612 3 287.3798632612 4 869.2433944257 5 869.2433944257 6 869.2433944259
Now, suppose that you re-run the problem after linking in and using the useracel subroutine. Your new results should look like those shown below: *** FREQUENCIES FROM BLOCK LANCZOS ITERATION *** MODE FREQUENCY (HERTZ) 1 239.2841196099 2 276.1423760135 3 287.3798632612 4 854.5488768013
5 6
865.5931519918 869.2433944258
c c *** ansys(r) copyright(c) 1998 c *** ansys, inc. c *** Notice - This file contains ANSYS Confidential information *** c 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 c input arguments: c variable (typ,siz,intent) description c intin (int,ar(12),in) - integers from command line c dpin (dp,ar(12),in) - double precision from command line c ch4in (ch*4,ar(12),in) - upper case 4 characters from command c ch8in (ch*8,ar(12),in) - as input 8 characters from command c c If the usage had been set up with a /ucmd,aaaa,1 , c user01 could be activated by the command aaaa,ln,6,all c where ln = lab4in(2) c 6 = intin(3) c all = lab4in(4) c c output arguments: none c user01 (int,sc,out) - result code (should be zero) c (which is ignored for now) c c ************************************************************** c intin(2), dpin(2), ch4in(2), and ch8in(2) are all representations c of the contents of the second field on the command line c (the field after the command label) c ************************************************************** c external wrinqr integer wrinqr c integer user01,intin(12), iott double precision dpin(12) character*4 ch4in(12) character*8 ch8in(12) c iott = wrinqr(2) c c ***** user'S CODE IS INSERTED HERE ***** write (iott,2000) 2000 format (//' ***** CALL TO ANSYS,INC DUMMY USER01 *****'//) c c ***** do not return this result code in a real user routine user01 = -654321 c ***** instead return a zero ***** c user01 = 0 c return end
description integers from command line double precision from command line upper case 4 characters from command as input 8 characters from command
************************************************************** intin(2), dpin(2), ch4in(2), and ch8in are all representations of the contents of the second field on the command line (the field after the command label) ************************************************************** external integer wrinqr,ndinqr,ndgxyz,ndpxyz,erhandler wrinqr,ndinqr,ndgxyz
integer user02,intin(12), iott, maxnp,i,ksel double precision dpin(12),xyz(3) character*4 ch4in(12) character*8 ch8in(12) #include "ansysdef.inc" maxnp = ndinqr (0,DB_MAXDEFINED) do i = 1,maxnp ksel = ndgxyz (i,xyz(1)) if (ksel .eq. 1) then xyz(1) = xyz(1) + dpin(2) xyz(2) = xyz(2) + dpin(3) xyz(3) = xyz(3) + dpin(4) call ndpxyz (i,xyz(1)) endif enddo c ***** write to output file iott = wrinqr(WR_OUTPUT) write (iott,2000) 2000 format (/' NODE OFFSET COMPLETE *****
'/)
***** write to GUI window ***** call erhandler ('user02',3000, x 2,'NODE OFFSET COMPLETE',0.0d0,' ')
*****
Get nodal xyz locations and calculate standard deviation of x coordinates, y coordinates, & z coordinates
if (numnp .le. 0) go to 999 c allocate memory for x, y, & z coordinates of nodes xcptr = HeapAllocPtr(numnp,'XCoords ',HEAP_DOUBLE,hXcptr) ycptr = HeapAllocPtr(numnp,'YCoords ',HEAP_DOUBLE,hYcptr) zcptr = HeapAllocPtr(numnp,'ZCoords ',HEAP_DOUBLE,hZcptr) loop through all selected nodes i=1 node = 0 xmean = 0.0d0 ymean = 0.0d0 zmean = 0.0d0 node = ndnext(node) if (node .gt. 0) then c get xyz coordinates ksel = ndgxyz (node,xyz(1)) store this node's dstack(xcptr + i) dstack(ycptr + i) dstack(zcptr + i) while xmean ymean zmean xyz coordinates = xyz(1) = xyz(2) = xyz(3)
10
we're looping, accumulate sums to calculate means = xmean + xyz(1) = ymean + xyz(2) = zmean + xyz(3)
increment index i = i + 1 loop back up for next selected node goto 10 endif
c c
node = 0, at the end of node list calculate mean of xyz coordinates xmean = xmean / numnp ymean = ymean / numnp zmean = zmean / numnp calculate standard deviation for xyz coordinates sodx = 0 sody = 0 sodz = 0 do i=1, numnp sodx = sodx + (dstack(xcptr+i) - xmean)**2 sody = sody + (dstack(ycptr+i) - ymean)**2 sodz = sodz + (dstack(zcptr+i) - zmean)**2 enddo stdxyz(1) = sqrt(sodx / (numnp-1)) stdxyz(2) = sqrt(sody / (numnp-1)) stdxyz(3) = sqrt(sodz / (numnp-1))
***** write to output file ***** iott = wrinqr(WR_OUTPUT) write (iott,2000) stdxyz(1),stdxyz(2),stdxyz(3) 2000 format (/' STD FOR X COORDINATES:',G12.5,/, X ' STD FOR Y COORDINATES:',G12.5,/, X ' STD FOR Z COORDINATES:',G12.5)
***** write to GUI window ***** call erhandler ('user03',5000,2, x 'STD FOR X COORDINATES: %G %/ STD FOR Y x COORDINATES: %G %/ STD FOR Z COORDINATES: %G',stdxyz(1),' ') release dynamically allocated memory call HeapDealloc(hXcptr) call HeapDealloc(hYcptr) call HeapDealloc(hZcptr) ***** required return value user03 = 0 return end *****
c 999
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
c *** Notice - This file contains ANSYS Confidential information *** c Prolog is not CONFIDENTIAL INFORMATION c c c c c c c c c c c c c c typ=int,dp,log,chr,dcp input arguments: variable (typ,siz,intent) Node (int,sc,in) Label (ch*4,sc,in) siz=sc,ar(n) intent=in,out,inout
description - Node Number (User) - DOF Label (Upper Case) 'UX ','UY ','TEMP','VOLT','ROTY', etc
Value
(dp,sc,out)
description - status/pointer = 0 - data not valid > 0 - dstack pointer to data for fast access see comments below - Solution value for Node,Label
example usage:
c external GetStackDisp c#include "stack.inc" (only if dstack(ptr) form is used) c integer GetStackDisp, ptr, Node2 c double precision Value c c c ptr = GetStackDisp (Node2,'UY ',Value)
description - Result Type - Result Component (8 char for ESTR) - 'AVG ' or 'NOAV' ('AVG ' default)
- Code for data type - Number of values per point If 0, no data - Location of Comp in values
subroutine ElResultGet (nPoints,ebest,elcord,TypeData,Loc, nVal,result) c *** primary function: (post1) Get results at selected points x c *** Notice - This file contains ANSYS Confidential information *** c (prolog is not confidential) c c c c c c c c c c c c input arguments: variable (typ,siz,intent) description nPoints (int,sc,in) - Number of evaluation points *** from ElInterp *** ebest (int,ar(nPoints),in) - Element(s) containing points elcord (dp,ar(3,nPoints),in) - Element coordinates *** from ElResultStrt *** TypeData (int,sc,in) - Data type code Loc (int,sc,in) - Start of selected data nVal (int,sc,in) - Number of results per point output arguments: Result (dp,ar(nvar,nPoints),out)
- Array of results
c primary function: Find element numbers containing xyz points c secondary functions: Find element coordinates of these points c object/library: upf c *** Notice - This file contains ANSYS Confidential information *** c (Prolog is not CONFIDENTIAL INFORMATION) c typ=int,dp,log,chr,dcp siz=sc,ar(n) intent=in,out,inout
c input arguments: c variable (typ,siz,intent) c nPoints (int,sc,in) c xyzPoints(dp,ar(3,nPoints),in)c tolInside(dp,sc,in) c c tolOutside(dp,sc,in) c c output arguments: c variable (typ,siz,intent) c ebest (int,ar(nPoints),out) c elcord (dp,ar(3,nPoints),out)
description Number of points to find (do in one group) XYZ coordinates of each point Tolerance for point inside element (0.0d0 defaults to 1.0d-4) Maximum distance outside to be associated with an element (0.0d0 defaults to 0.25) description - Best element number for each point - Element coordinates of the point
User Subroutine Is Called UAnBeg USolBeg ULdBeg USsBeg UltBeg UltFin USsFin ULdFin USolFin UAnFin At ANSYS start-up Before solution Before a load step Before a substep Before an iteration After an iteration After a substep After a load step After solution At the end of an ANSYS run
Subroutines USSBeg, UItBeg, UItFin and USSFin default to reading a command macro file from the current working directory whose name is subroutine.mac (i.e., 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 subroutine must be activated by the USRCAL command. The design of the command reading ability of these subroutines 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, *STAT. 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, etc). If these capabilties are required, the user will need to create a Fortran subroutine and link this subroutine into ANSYS, as described in Section 1.1. While parameter substitution into commands is not permitted, USSBeg, etc. 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,c,active,solu,Time,cpu *dim,array,,6 array(1) = 1 array(2) = 2 array(3) = 3 array(4) = 4 array(5) = 5 array(6) = 6
*vleng,3 *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
/COM, COMMANDS BELOW THIS LINE ARE KNOWN TO NOT WORK p,1,6,2000 d,1,uy,.1 *msg,note THIS IS A TEST MESSAGE *vwrite,array(1) (/ b = ,f10.4) ! commands DO NOT work
Link a user routine within the ANSYS program. Run a stand-alone optimization program using the ANSYS optimization "save" file, Jobname.OPT.
This chapter describes both methods. You can find additional information on design optimization techniques and procedures in Chapter 1 of the ANSYS Advanced Analysis Techniques Guide.
For information about the kopusr variable and the userop routine, see the next section.
c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c C c c c c
- (not used - spares) - convergence flag (kconv = 0 indicates convergence) - flag choosing optimizer (0 = ansys, 1 = user-supplied opt) (issuing the command optype,user sets kopusr = 1) lopt - incrementing lopt iteration counter maxdv - maximum number of design variables allowed in ansys optimization (= 60) maxpar - maximum number of parameters allows in ansys optimization (= 400) maxopt - maximum number of design sets allowed in optimization (= 130) nobj - flag for objective function defined (0=no, 1=yes) ntdv - total number of design variables ntsv - total number of state variables numopt - total number of design sets nsets - highest design set number setnum(1) - the actual design set number of the ith design set oplim(j,I) - Lower limit (j=1) and upper limit (j=2) of ith optimization parameter (opvar). (I = 1 to 160.) The state variables are stored first, then the design variables, and then the objective function optol(I) - tolerance of ith optimization parameter (opvar) (I = 1 to 160.) The state variables are stored first, then the design variables. optvar(I,j) - The ith parameter of the jth design set (I = 1 to maxpar, j = 1 to maxopt) The state variables are stored first, then the design variables, then the objective function, and finally all remaining scalar parameter values. maxusr - user-specified, maximum allowed optimization iterations on the opuser command opus(I) - user-specified, double precision parameters on the opuser command (I = 1,8) objtol - objective function tolerance
When you finish customizing the userop routine, you relink it using either of the methods described in section 1.1.8 and in the ANSYS Installation and Configuration Guide for UNIX or in the ANSYS Installation and Configuration Guide for Windows. 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.
! ANSYS optimization logic bypassed ! user-defined optimization to be done ! design and state variables & objective function values defined
! looping begins
minimize y = x1**2 + x2**2 subject to: 1 < x1 < 10 1 < x2 < 10 g = x1 - x2 > 1 ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! use batch mode initial value for dv x1 initial value for dv x2 enter the ANSYS preprocessor define function y define function g finish prep finish preprocessing define first dv (range 1 to 10) define second dv (range 1 to 10) define objective function (tol = 1) define state variable (lower limit 1) user user-defined optimization logic define user opt. Modifiers (max iterations=10) execute userop routine list results
/batch,list x1=5 x2=5 /prep7 y = x1*x1 + x2*x2 g = x1 - x2 finish /opt opvar,x1,dv,1,10 opvar,x2,dv,1,10 opvar,y,obj,,,1 opvar,g,sv,1 optype,user opuser,10,1.1,2.0 opexe oplist,all finish
! ANSYS optimization logic bypassed ! user-defined optimization to be done ! design and state variables & objective function values defined
! ! ! !
jobname.opt written for use by user-supplied program run the user-supplied program read results of user-supplied program from jobname.out looping begins
The OPSAVE and OPRESU commands write data to and read data from Jobname.OPT, and they also pass data to and from your custom optimization program.
andir anext annam bestsave bestset con1 con2 delfst delgr dvloop facexp facfst faclst factq fstfst fstpnt gradq(I) grdfst grdlst grdpnt grdtyp icongr ilamda inopt iobjxp
Analysis file directory Analysis file extension Analysis file name Key to save the best database and results file Number of the current best optimization set Minimum parameter value Maximum parameter value Forward difference for first order optimization (delta on opfrst) Forward difference for gradient optimization tool (delta on opgrad) Indicates how to treat design variables on the loop file Fractional exponent for factorial optimization First design set number in the range of factored sets Last design set number in the range of factored sets Factor applied to penalty functions (first order optimization only) First design set number in the range of first order sets Reference design set number for first order optimization Vector saved for first order optimization First design set number in the range of gradient sets Last design set number in the range of gradient sets Reference design set number for gradient evaluation Reference design set type (best, last, or number) for gradient Key for selecting conjugate direction method Exponent that controls the resolution (sharpness) of the unconstrained objective function (in first order optimization) Reserved for internal ANSYS use Reserved for internal ANSYS use
iopexe(I) Executable keys indicating which method or tool was run isvxp jobnam kconv kfit1 kfit2 kopusr kwght labx(k) loopct lpot looptl loptlp maxfac maxfst maxinf maxrnd maxsub mxpmrs nbest0 nfeas ninfes nmswps nobj noqv Reserved for internal ANSYS use Current name for file creation or use Convergence flag (kconv = 0 indicates convergence) Reserved for internal ANSYS use Reserved for internal ANSYS use Flag choosing optimizer (0 = ansys, 1 = user optimization) Reserved for internal ANSYS use Current parameter names Incrementing loop counter (for *GET command) Maximum number of design loops (from OPRUN command) Total number of optimization loops executed (using all methods) Saved value of lopt variable after each execution Maximum allowed number of loops for factorial optimization analysis Maximum allowed number of iterations for first order optimization Maximum allowed sequential infeasible solutions (subp) Maximum allowed number of iterations for random optimization Maximum allowed number of iterations for sub. prom. approx. Used for restart purposes (to reset mxparm in parmcm) Best design set this first order evaluation Desired number of feasible solutions (random optimization) Counter for consecutive infeasible solutions The number of sweep evaluations to be made in each design variable dir. Number of objective functions (must be 1) Reserved for internal ANSYS use
nrandm nsqv nsets ntdv ntfdf ntline ntmax ntsv numopt opam opdir opext opnam optlab optlab(I) optol(I)
Reserved for internal ANSYS use Reserved for internal ANSYS use Current number of sets that were made Total number of design variables Finite difference counter for first order optimization Line search counter for first order optimization Maximum number of parameters that have ever been defined Total number of state variables Total number of design sets Random settings (related to routine VRAND) Optimization file directory Optimization file extension Optimization file name All labels used in optimization (optimization labels and extras) Optimization labels Tolerance
optvar(I,j) Ith parameter of the jth design set opus(n) psobj0 rdfrom refobj User parameters specified on OPUSER command (n = 1:8) Best unconstrained objective value this first order evaluation Indicates where to begin reading the analysis file (0 = top, 1 = after /Prep7) Reference objective function for first order optimization
savoutunit Saved output unit number seed Reserved for internal ANSYS use
sq(j)
stmapmax Reserved for internal ANSYS use svparm swpfst swplst swppnt swptyp userp(n) vect(k) Indicates which type of parameters to save during looping First design set number in the range of sweep sets Last design set number in the range of sweep sets Reference design set number for sweep evaluation Reference design set type (best, last, or number) for sweep Reserved for internal ANSYS use Current scalar parameter values
For complex numbers: ptrcp =HeapAllocPtr(cleng,'C8Label ',HEAP_COMPLEX,cHandle) For real numbers: ptrr =HeapAllocPtr(rleng,'C8Label ',HEAP_REAL ,rHandle)
The starting location for the array(s) in the Heap memory area is also returned. Where leng(argument 1) is the number of array words needed:
G G
G G
C8Label (argument 2) is a character*8 block name. HEAP_xxx (argument 3) is the word size based on integer words. (The HEAP_xxx definitions are parameters in the ansysdef.inc common). Handle (argument 4) is returned as the block number. The block number is used to deallocate the space. Ptr (the function result) is the starting location of the data space, minus 1. You must include the ansysdef.inccommon to get the parameter values of HEAP_INTEGER, HEAP_DOUBLE, HEAP_COMPLEX, and HEAP_REAL.
4. Use the arrays. You must include the common stack.inc in the routines accessing the Heap space. You can find stack.inc on the ANSYS distribution medium. The location of the first data entry for the array depends on the type of numbers in the array: If the Array Contains Integer numbers The First Data Entry Begins at istack(ptri+1)
Double precision numbers dstack(ptrdp+1) Complex numbers Real numbers cstack(ptrcp+1) rstack(ptrr+1)
5. If one routine allocates Heap space and another routine uses the space, you need to pass only the "handle" to the second routine. You also must include the stack common, just as you did in Step 4. The HeapGetPtr function can retrieve the starting location minus 1, as follows: ptri =HeapGetPtr(iHandle) ptrdp =HeapGetPtr(dHandle) ptrcp =HeapGetPtr(cHandle) ptrr =HeapGetPtr(rHandle) This location is the same as the location described in Step 4. 6. Deallocate the stack space using the HeapDealloc subroutine, as follows: For integer numbers: call HeapDealloc(iHandle) For double precision numbers: call HeapDealloc(dHandle) For complex numbers: call HeapDealloc(cHandle)
For real numbers: call HeapDealloc(rHandle) The next few pages provide input and output listings for the memory management routines. For an example, see the section "Function user03 (Demonstrates Using Heap Memory)," which appears earlier in this chapter.
c object/library:
c *** Notice - This file contains ANSYS Confidential information *** c c c c c c c c c input arguments: nValues (int,sc,in) c16Label (ch*16,sc,in) flagAlloc(int,sc,in)
- Number of Values needed in Block - 16 character name for the Block - Flags describing this block (See ANSYSDEF and heapcom for more information)
- Handle (Block number) for this block - Pointer to this data block (Use Ptr+i) for reference to ith value in the block
c object/library:
c *** Notice - This file contains ANSYS Confidential information *** c c c c Note: See heapcom.inc for information on use of Heap
c keywords: integer function for heap pointer return c object/library: c current - heap c *** Notice - This file contains ANSYS Confidential information ***
c c c c c c
NOTE:
- A heap handle
c *** Notice - This file contains ANSYS Confidential information *** c c c c c c input arguments: label8 (chr*8,sc,in) labl4 (chr*4,sc,in) nxyz (int,ar(3),in) names (chr*8,ar(3),in) output arguments: none
the name of the parameter to create 'TABL' or 'ARRA' or 'CHAR' the dimensions of the array Names for x,y,z directions in table
- the name of the parameter (must be upper case, left justified) - the number of subscripts (0,scaler) - values for the subscripts (if any) - 0,1 no error output 2, report error -1, set kerr flag with no anserr call
- the value of the parameter (may be a packed character*8 - error flag (0,ok -1,output is packed 0=ok, 1=error, 2=error but TINY is used
c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c
is to be defined. ctype (int,sc,in) - 0, dp 1,character ctype is an integer key which describes the type of data that the parameter data holds. This would also indicate the contents of "value" (arg 5). 0=double precision data 1=character data - number of subscripts nval is the number of subscripts that the "label8" (arg 1) contains. 1=single dimensioned variable (ex. x(10)) 2=double dimensioned variable (ex. y(10,3)) 3=triple dimensioned variable (ex. z(10,3,2)) -1=delete this parameter from the internal tables. - values of subscripts subc is a double precision vector that contains the subscripts of "label8" (arg 1). There should be enough values defined to match "nval" (arg 3). For example if "x" was dimensioned as "x(10,3,2)" and you wanted to set "x(5,1,1)=123.0", then "nval" (arg 3) should be set to 3, and "subc" should be set to 5.0, 1.0, 1.0, and "value" (arg 5) should be 123.0. Another example is if "y" was dimensioned to as "y(20,20)" and you were setting "y(5,8)=987", then "nval" (arg 3) should be set to 2 and "subc" should be set to 5.0, 8.0, 0.0, and "value" (arg 5) should be 987.0. Remember subroutine "pardef" is only storing a data value of "label8" or "label8(x,y,z)". The proper dimensions were set by a "*dim" command. Please note that although the values of "subc" should be double precision, subroutine "pardef" uses the intrinsic "nint" (nearest integer) function to get and use the integer equivalent. You should also note the "nval" (arg 3) and "subc" (arg 4) must fall within the range that was set with a "*dim" or "*set" command or an error will occur. value (dp,sc,in) - the value for this parameter (should be a packed character*8 if ctype=1. To pack a char into a dp variable use "call chtodp(ch8,dp)". To unpack a dp variable into a char use "call dptoch(dp,ch8)" ) Value is the data value that is to be stored for "label8" (arg 1). If "ctype=1" (arg 2) then this value would be a "packed character" data from the "chtodp" Ansys function.
nval
(int,sc,in)i
subc (dp,ar(3),in)
- error flag (0=ok, 1=error) kerr is an integer error flag that is returned to the calling subroutine. Any
c c
non zero number would indicate an error was detected in subroutine "pardef"
Note-For a demonstration of parameter processing, see the examples based on the useracel routine in this manual. You can find examples in section 1.7.7.
The erhandler routine displays output messages (notes, warnings, and errors). The runcmd 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 function enables you to do program tracing and timing.
For further descriptions of erhandler and /TRACK, see Chapter 3, "Subroutines for Users' Convenience." For details about the GetStackDisp function, see section 1.10.2.
ON, to write the undo file OFF, to prevent the undo file from being written PROMPT, to have ANSYS ask permission before writing the file STATUS, to restore the file as it existed after executing the last command issued before the /UNDO command.
G G
Filename is 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 is the length of time, in seconds, that ANSYS waits before trying to read the message file again. Timeout is the maximum length of time, in seconds, that ANSYS can wait between attempts to read the file.
Argument type is one of the following: 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
2.4.2 ndprev Function (Getting the Number of the Previous Selected Node)
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
2.4.3 ndnxdf Function (Getting the Number of the Next Defined Node)
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 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 number used c = 0 - use for initial value c c output arguments: c elnext (int,func,out) - the next selected element c = 0 - no more elements
2.4.6 elprev Function (Getting the Number of the Previous Selected Element)
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
2.4.7 elnxdf Function (Getting the Number of the Next Defined Element)
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
c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c
= DB_MAXDEFINED - return highest node number defined = DB_MAXRECLENG - return maximum record length (dp words) = 2, return length (dp words) = 3, = 11, return void percent (integer) = -1, = -2, superelement flag = -3, master dof bit pattern = -4, active dof bit pattern = -5, solid model attachment = -6, pack nodal line parametric value = -7, constraint bit pattern = -8, force bit pattern = -9, body force bit pattern = -10,internal node flag = -11, = -12, =-101, pointer to node data record =-102, pointer to angle record =-103, pointer to attached elements =-104, pointer to attached couplings =-105, pointer to attacted constraint equations =-106, pointer to nodal stresses =-107, pointer to specified disp'S =-108, pointer to specified forces =-109, pointer to x/y/z record =-110, =-111, =-112, pointer to nodal temperatures =-113, pointer to nodal heat generations =-114, =-115, pointer to calculated displacements =-116, output arguments: ndinqr (int,func,out)
c c c c c c c c c c c c
kcrot
(int,sc,in)
- output coordinates in this coordinate system. if kcrot is negative, output theta and phi coordinates in radians
- Coordinates (first 3 values) and rotation angles (last 3 values) - select status = 0 - node is selected = 1 - node is not defined =-1 - node is unselected
description - node number - array of 3 nodal 3 nodal - local coordinate coordinates and
coordinates and rotation angles. system in which the nodal angles are defined
2.5.4 ndgall Function (Getting the XYZ/Rotation Coordinates Vector for a Node)
function ndgall (node,xyz) c *** primary function: get x,y,z,rotx,roty,rotz vector for a node. c c *** Notice - This file contains ANSYS Confidential information *** c c input arguments: c node (int,sc,in) - node number for operation. c 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 c
Node of an Element)
subroutine ndspgt (node,dofs,ndof,nrot,xyzang,nuvect,unode) c *** primary function: get the nodal solution for a node of an element c c *** Notice - This file contains ANSYS Confidential information *** c c input arguments: c node (int,sc,in) - The node number c dofs (int,sc,in) - The dofs to retrieve for the node. c dof = degree of freedom c This is an integer representation using c bit pattern logic of the dof or the dof c set. This is normally done using the c parameters defined in echprm. Then c you could use dofs = UX + UY in the c calling routine, for example. 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 c output arguments: c unode (dp,ar(ndof,nuvect),out) - Element nodal solution vectors in c the global coordinate system. c
c DB_NUMSELECTED, or DB_MAXDEFINED c key (int,sc,in) - information flag. c = DB_SELECTED - return select status: c elmiqr = 0 - element is undefined. c =-1 - element is unselected. c = 1 - element is selected. c = DB_NUMDEFINED - return number of defined elements c = DB_NUMSELECTED - return number of selected elements c = DB_MAXDEFINED - return maximum element number used c = DB_MAXRECLENG - return maximum record length 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 = 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. (see elmcmx) c c output arguments: c elmiqr (int,func,out) - the returned value of elmiqr is based on c setting of key. c #include "impcom.inc" c external vminqr,virtrd integer vminqr c integer elmiqr, ielem, key, j, iloc(2) c
c c c c c c c c c c c c c c c c c c c c c c c c c c c c c
siz=sc,ar(n),func
intent=in,out,inout
elmdat
- status of element. = 0 - element undefined < 0 - number of nodes on unselected element > 0 - number of nodes on selected element (int,ar(10),out) - element attributes. elmdat(1) - material number (2) - element type (3) - real constant number (4) - element number (obsolete, do not use) (5) - coordinate system number (6) - death flag if 0 - alive if 1 - dead (7) - solid model reference (8) - 100*shape + specific shape (9) - reserved (10) - p element include flag if 0 - include if 1 - exclude (int,ar(*),out) - node numbers for element.
nodes
c c c c c c c c
nnod nodes
(int,sc,in) (int,ar(*),in)
if 0 - include if 1 - exclude - number of nodes for this element. - node numbers for this element.
c c c c c c c c c c c c c c c
= 2 - xref data tables = 3 - bitmap data (for 32 data item packed records) = 4 - data tables (three dimensional arrays) = -n, return element characteristic n from etycom for element type itype. n is correlated to the parameter names in echprm. see elccmt for definitions of element characteristics. note- this will not overwrite the current setting of etycom. output arguments: etyiqr (int,func,out)
c c c c c c c c
itype n ielx
- element type number for operation. - length of data vector to store. - element type data. see elccmt for description.
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 iott (int,sc,in) - printout file c ielc (int,ar(150),inout) - input element characteristics c in positions 1 to 20. c (itype, jstif, keyopts, etc.) c c output arguments: c elcdn (chr,sc,out) - element descriptive name as character c string c ielc (int,ar(150),inout) - output element characteristics c in positions 21 to 150. c (kdim, ishap, idegen, etc.) c see elccmt for a full list c kerr (int,sc,out) - error flag c = 0 - no errors c = 1 - errors c
c c c c c c c c c c
ksel
(int,sc,in)
= 0 - all element types - type of operation to be performed. = 0 - delete element type. = 1 - select element type. =-1 - unselect element type. = 2 - invert element type.
c c
setting of key.
c c c c c c c c c c c
USER=73, NL
=74, HYPE=75, NNEW=76, MOON=77, OGDE=78, SUTH=79, WIND=80 (see mpinit for uncommented code) - number of entries in the table (1 to 100) - temperature vector (ascending) - property vector
c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c
nreal
(int,sc,in)
key
- real constant table number should be 0 for key=11, DB_NUMDEFINED, DB_NUMSELECTED, DB_MAXDEFINED, and DB_MAXRECLENG (int,sc,in) - information flag. = DB_SELECTED - return select status rlinqr = 0 - real constant table is undefined. =-1 - real constant table is unselected. = 1 - real constant table is selected = DB_NUMDEFINED - return number of defined real constant tables = DB_NUMSELECTED - return number of selected real constant tables = DB_MAXDEFINED - return highest real constant table defined = DB_MAXRECLENG - return maximum record length (dp words) = 2 - return length (dp words) = 3 - return layer number (for cross reference files return number of entities) = 4 - return address of first data word = 5 - return length (in record type units) = 6 - return compressed record number. = 11 - return void percent (integer) = 16 - return location of next record (this increments the next record count) = 18 - return rlinqr = = = = = = = 19 - return rlinqr = = = = = type of file. 0 - integer 1 - double precision 2 - real 3 - complex 4 - character*8 7 - index virtual type of file. 0 - fixed length (4.4 form) 1 - indexed variable length (layer data) 2 - xref data tables 3 - bitmap data (for 32 data item packed records) 4 - data tables (three dimensional arrays)
c c
rtable
(dp,ar(*),out)
c c c
csyiqr
(int,func,out)
c c c c c c c c c c c c c c c c c c c c
variable (typ,siz,intent) description csycom name ncsy (int,sc,in) - coordinate system number csydpx (dp,ar(18),out) csydpx(1-9) - transformation matrix (10-12) - origin (XC, YC, ZC) (13-14) - coordinate system parameters cparm cparm2 (15) - spare (16-18) - defining angles csyinx (int,ar(6),out) csyinx(1-2) - theta, phi singularity keys (3) - coordinate system type icdsys (4) - coordinate system number csyact (5) - spare (6) - spare
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 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 c output arguments: c cpinqr (int,func,out) - the returned value of cpinqr is based on c setting of key c
c c c c c c c c c c c c c c c c c c c c c c c c c c c c c
= DB_SELECTED
description - constraint equation number - inquiry key: should be zero for key=11, DB_NUMDEFINED, DB_NUMSELECTED, DB_MAXDEFINED, and DB_MAXRECLENG return select status ceinqr = 1 - equation is selected = 0 - equation is undefined =-1 - equation is unselected return number of defined contraint equations return number of selected contraint equations return number of highest numbered constraint equation defined return length of longest contraint equation set (max record length) return length (data units) return layer number address of first data word return void percent (integer) return location of next record return master dof for this eqn
subroutine ceput (nce,n,ieqn,deqn) c *** primary function: store a constraint equation c *** secondary functions: none c *** Notice - This file contains ANSYS Confidential information *** c c c c c c c c c c input arguments: nce (int,sc,in) - constraint equation set number n (int,sc,in) - number of degrees of freedom in set ieqn (int,ar(n+1),in) - integer info ieqn(1:n) - node*32+dof for each dof in set ieqn(n+1) - number of dof in set (copy of n above) deqn (dp,ar(n+1),in) - dp info deqn(1:n) - coefficients of each dof in set deqn(n+1) - constant term output arguments: none
c c c c c c c c c c c c
variable (typ,siz,intent) description node (int,sc,in) - node number for inquire. key (int,sc,in) - key as to the information needed = 1 - return constraint mask = DB_MAXDEFINED, DB_NUMDEFINED - return number of nodal constraints NOTE: both DB_MAXDEFINED and DB_NUMDEFINED produce the same functionality output arguments: disiqr (int,func,out)
c c c c c c c c c c c c c
variable (typ,siz,intent) description node (int,sc,in) - node number idf (int,sc,in) - reference number of DOF: (1-32) UX = 1, UY = 2, UZ = 3, ROTX= 4, ROTY= 5, ROTZ= 6, AX = 7, AY = 8 AZ = 9, VX =10, VY =11, VZ =12 PRES=19, TEMP=20, VOLT=21, MAG =22, ENKE=23, ENDS=24 EMF =25, CURR=26 (missing entries are spares) value (dp,ar(2),in) - (real,imag) values for constraint
c c c c c c
NOTE: both DB_MAXDEFINED and DB_NUMDEFINED produce the same functionality output arguments: foriqr (int,func,out)
c c c
c c c c c c c
input arguments: variable (typ,siz,intent) node (int,sc,in) hg (dp ,sc,in) output arguments: none.
function nfuget (node,fluen) c *** primary function: get specified nodal fluence. 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: 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).
function ndciqr (node,key) c *** primary function: get information about nodel current densities 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 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 c c output arguments: c ndciqr (int,func,out) - the returned value of ndciqr is based on c
c c c
2.8.25 nvdiqr Function (Getting Information About Nodal Magnetic Virtual Displacements)
function nvdiqr (node,key) c *** primary function: get information about nodal mag virtual disps 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 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 c output arguments c nvdiqr (int,func,out) - the returned value of nvdiqr is based on c
c c c c c c c c c c c c c c
siz=sc,ar(n),func
intent=in,out,inout
virtd
(dp ,sc,out)
- virtual disp status of node. = 0 - node has no magnetic virtual displacement = 1 - node has a magnetic virtual displacement - the nodal virtual displacement value
c c c c c c c c c c c
iface
(int,sc,in)
value
(dp ,ar(*),out)
- status of element. =-1 - element has no pressures = 0 - this element face has no pressures > 0 - number of values defined - the element pressures (real,imag) at each face
c c c c c c c c c c c c c c c c c c c c
iface
(int,sc,in)
value
(dp ,ar(*),out)
- status of element. =-1 - element has no convections/heat fluxes = 0 - this element face has no convections/heat fluxes > 0 - number of values defined - the element convections NOTE: Two values at each node of an element face: if loading is a convection, the first first value is the film coefficient and the second value is the bulk temperature. If loading is a heat flux, the first value is the heat flux, and the second value is a large number
c c c c c c c c c c c c
description - element number. - face number = 0 - delete all convections on this element = 1-6 - delete convections on this face
c c c c c c c c c c c
= 1 - indexed variable length (layer data) = 2 - xref data tables = 3 - bitmap data (for 32 data item packed records) = 4 - data tables (three dimensional arrays)
c c c
c c c c c c c c c c c c c c c c c c c c
= = = = = = 19 - return ehgiqr = =
1 - double precision 2 - real 3 - complex 4 - character*8 7 - index virtual type of file. 0 - fixed length (4.4 form) 1 - indexed variable length (layer data) = 2 - xref data tables = 3 - bitmap data (for 32 data item packed records) = 4 - data tables (three dimensional arrays)
c c c c c c c c c
variable (typ,siz,intent) ielem (int,sc,in) n (int,sc,in) qgen (dp ,ar(n),in) output arguments: none
description - element number - number of element heat generation values - element heat generations
c c c c
c c c c c c c c c
typ=int,dp,log,chr,dcp input arguments: variable (typ,siz,intent) ielem (int,sc,in) output arguments: none
siz=sc,ar(n),func
intent=in,out,inout
c c c c c c c c
value
(dp,ar(*),out)
= 0 - element has no current densities defined > 0 - number of element current densities defined - element current densities NOTE: If a value is not defined, it will
c c c c c c c c c c c c c c c c c c c c c
typ=int,dp,log,chr,dcp
siz=sc,ar(n),func
intent=in,out,inout
input arguments: variable (typ,siz,intent) description ielem (int,sc,in) - element number or zero (see below) key (int,sc,in) - key as to the information needed = 1 or DB_MAXRECLENG - return element virt disps info for ielem > 0 - number of virt disps defined for this element (rec length) = 0 - maximum number of virt disps defined for any element (max rec length) = DB_NUMDEFINED, = DB_MAXDEFINED - return total number of virt disps defined in model NOTE: both DB_NUMDEFINED and DB_MAXDEFINED produce the same functionality output arguments: evdiqr (int,func,out)
c c c c c c c c c c c c
typ=int,dp,log,chr,dcp input arguments: variable (typ,siz,intent) ielem (int,sc,in) n (int,sc,in) value (dp,ar(n),in) output arguments: none
siz=sc,ar(n),func
intent=in,out,inout
description - element number - the total number of values - element virtual displacments
c c c c c c c
iface
(int,sc,in)
- face number = 0 - delete all impedences on this element = 1-6 - delete impedence on this face
2.9.32 esfiqr Function (Getting Information About Element Surface Stress Data)
function esfiqr (ielem,key) c *** primary function: get information about element surface stress data 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 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 c output arguments: c esfiqr (int,func,out) - the returned value of esfiqr is based on c setting of key c c
c c c c c c c c c c c
description - element number - face number = 0 - all flagged surfaces = 1-6 - this flagged surface
c c c c c c c c c c c c c c c c c c c c c c c
= =
1 5
- return flagged surfaces mask for element - return number of flagged surfaces for this element face
= DB_NUMDEFINED, = DB_MAXDEFINED - return value is based on setting of iface NOTE: both DB_NUMDEFINED and DB_MAXDEFINED produce the same functionality iface = 0 - return total number of pressures, convections, etc defined in model = 1-6 - return number of flagged surfaces defined for this element. (rec length) NOTE: only 1-6 is valid, but this routine simply checks that iface is in the range. The actual value of iface does not matter in this case. = DB_MAXRECLENG - return maximum number of flagged surfaces for any element (max rec length) output arguments: variable (typ,siz,intent) efsiqr (int,func,out)
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 > 0 - return result mask at this node c = 0 - return number of calculated c displacements in model c key (int,sc,in) - key as to the information needed c At this time, key should always = 1 c c output arguments: c dspiqr (int,func,out) - the returned value of dspiqr is based on
- node number - number of results to be stored - reference number for the DOF: (1-32) - displacement values
output arguments:
none
2.10.5 emsiqr Function (Getting Information About an Element's Miscellaneous Summable Data)
function emsiqr (ielem,key) c *** primary function: get information about element misc summable data 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 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 c output arguments: c emsiqr (int,func,out) - the returned value of emsiqr is based on c setting of key
c *** primary function: delete element misc summable data 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 ielem (int,sc,in) - element number c = 0 - delete data for all defined elements c c output arguments: c none c
c c c c c c c c c
value
(dp,ar(*),out)
- status of element. = 0 - element has no nodal forces > 0 - number of nodal forces returned - element nodal forces
c c c c c c c c c c c c c c c c c c c
stresses for "first" layer at each corner node (first at the bottom surface of the bottom layer, then the top surface of the top layer). Stresses for "second" layer at each corner node (first the bottom surface, then the top surface for the layer with the largest failure criteria). The second layer is not present if failure criteria were not used or are not appropriate For layered elements (w/KEYOPT(8)=1), stresses for each layer at each corner node (first at the bottom surface, then the top surface) For beam elements, the contents of this record is element depenent. See LS item of ETABLE command.
c c c c c c c c c c c
The second layer is not present if failure criteria were not used or are not appropriate For layered elements (w/KEYOPT(8)=1), stresses for each layer at each corner node (first at the bottom surface, then the top surface) For beam elements, the contents of this record is element depenent. See LS item of ETABLE command.
c c c c c c
c c c
function egrget (ielem,value) c *** primary function: get element nodal gradients. 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 ielem (int,sc,in) - element number c 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 c c Note: If a coupled field, a set of c gradients are stored in the following c order (as available): fluid, thermal, c electric, magnetic c
c *** primary function: delete element nodal gradients 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 ielem (int,sc,in) - element number c = 0 - delete for all defined elements c c output arguments: c none. c
2.10.25 eeliqr Function (Getting Information About an Element's Nodal Elastic Strains)
function eeliqr (ielem,key) c *** primary function: get information about element nodal elastic strains 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 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 elastic strains c ielem > 0 - return number of nodal elasic strains c on this element (rec length) c = 0 - return maximum number of nodal elastic c strains on any element c (max rec length) c = DB_NUMDEFINED - return the number of nodal elastic strains c defined in model c c output arguments: c eeliqr (int,func,out) - the returned value of eeliqr is based on c
c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c
value
(dp,ar(*),out)
- status of element. = 0 - element undefined > 0 - number of nodal elastic strains returned - element nodal elastic strains
NOTE: Strains at each corner node in the order X, Y, Z, XY, YZ, XZ For solid elements, strains at each corner node For shell elements, strains at each corner node (first top durface, then bottom) For layered elements (w/KEYOPT(8)=0), strains for "first" layer at each corner node (first at the bottom surface of the bottom layer, then the top surface of the top layer). Strains for "second" layer at each corner node (first the bottom surface, then the top surface for the layer with the largest failure criteria). The second layer is not present if failure criteria were not used or are not appropriate For layered elements (w/KEYOPT(8)=1), strains for each layer at each corner node (first at the bottom surface, then the top surface) For beam elements, the contents of this record is element depenent. See LEPEL item of ETABLE command.
c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c
output arguments: none NOTE: Strains at each corner node in the order X, Y, Z, XY, YZ, XZ For solid elements, strains at each corner node For shell elements, strains at each corner node (first top durface, then bottom) For layered elements (w/KEYOPT(8)=0), strains for "first" layer at each corner node (first at the bottom surface of the bottom layer, then the top surface of the top layer). Strains for "second" layer at each corner node (first the bottom surface, then the top surface for the layer with the largest failure criteria). The second layer is not present if failure criteria were not used or are not appropriate For layered elements (w/KEYOPT(8)=1), strains for each layer at each corner node (first at the bottom surface, then the top surface) For beam elements, the contents of this record is element depenent. See LEPEL item of ETABLE command.
2.10.29 epliqr Function (Getting Information About an Element's Nodal Plastic Strains)
function epliqr (ielem,key) c *** primary function: get information about element nodal plastic strains 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 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 c c output arguments: c epliqr (int,func,out) - the returned value of epliqr is based on c setting of key c
c c c c c c c c c c c c c c c c c c
corner node (first at the bottom surface of the bottom layer, then the top surface of the top layer). Strains for "second" layer at each corner node (first the bottom surface, then the top surface for the layer with the largest failure criteria). The second layer is not present if failure criteria were not used or are not appropriate For layered elements (w/KEYOPT(8)=1), strains for each layer at each corner node (first at the bottom surface, then the top surface) For beam elements, the contents of this record is element depenent. See LEPPL item of ETABLE command.
c c c c c c c c c c
failure criteria were not used or are not appropriate For layered elements (w/KEYOPT(8)=1), strains for each layer at each corner node (first at the bottom surface, then the top surface) For beam elements, the contents of this record is element depenent. See LEPPL item of ETABLE command.
2.10.33 ecriqr Function (Getting Information About an Element's Nodal Creep Strains)
function ecriqr (ielem,key) c *** primary function: get information about element nodal creep strains 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 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 c c c
Strains)
subroutine ecrput (ielem,nval,value) c *** primary function: store nodal creep strains at an 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 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 c c output arguments: c none c NOTE: Strains at each corner node in the order c X, Y, Z, XY, YZ, XZ c For solid elements, strains at each c corner node c For shell elements, strains at each c corner node (first top durface, then c bottom) c For layered elements (w/KEYOPT(8)=0), c strains 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 Strains 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 strains 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 LEPCR c item of ETABLE command. c
c c c c c c c c c c
siz=sc,ar(n),func
intent=in,out,inout
2.10.37 ethiqr Function (Getting Information About an Element's Nodal Thermal Strains)
function ethiqr (ielem,key) c *** primary function: get information about element nodal thermal strains 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 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 c output arguments: c ethiqr (int,sc,out) - the returned value of ethiqr is based on c
c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c
ethget
(int,func,out)
value
(dp,ar(*),out)
- status of element. = 0 - element undefined > 0 - number of nodal thermal strains returned - element nodal thermal strains NOTE: Strains at each corner node in the order X, Y, Z, XY, YZ, XZ For solid elements, strains at each corner node For shell elements, strains at each corner node (first top durface, then bottom) For layered elements (w/KEYOPT(8)=0), strains for "first" layer at each corner node (first at the bottom surface of the bottom layer, then the top surface of the top layer). Strains for "second" layer at each corner node (first the bottom surface, then the top surface for the layer with the largest failure criteria). The second layer is not present if failure criteria were not used or are not appropriate For layered elements (w/KEYOPT(8)=1), strains for each layer at each corner node (first at the bottom surface, then the top surface) For beam elements, the contents of this record is element depenent. See LEPTH item of ETABLE command.
c c c c c c c c c c c c c c c c c c c c c c c c c c c
X, Y, Z, XY, YZ, XZ For solid elements, strains at each corner node For shell elements, strains at each corner node (first top durface, then bottom) For layered elements (w/KEYOPT(8)=0), strains for "first" layer at each corner node (first at the bottom surface of the bottom layer, then the top surface of the top layer). Strains for "second" layer at each corner node (first the bottom surface, then the top surface for the layer with the largest failure criteria). The second layer is not present if failure criteria were not used or are not appropriate For layered elements (w/KEYOPT(8)=1), strains for each layer at each corner node (first at the bottom surface, then the top surface) For beam elements, the contents of this record is element depenent. See LEPTH item of ETABLE command.
2.10.40 ethdel Subroutine (Deleting an Element's Thermal, Initial, and Swelling Strains)
subroutine ethdel (ielem) c *** primary function: delete element thermal, initial, and c swelling strains 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 ielem (int,sc,in) - element number c = 0 - delete for all defined elements c c output arguments: c none. c
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 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 c output arguments: c euliqr (int,func,out) - the returned value of euliqr is based on c
c *** primary function: get information about element fluxes 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 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 c output arguments: c efxiqr (int,func,out) - the returned value of efxiqr is based on c
c c c c c c c c c c c c c c c c c
typ=int,dp,log,chr,dcp input arguments: variable (typ,siz,intent) ielem (int,sc,in) nval (int,sc,in) value
siz=sc,ar(n),func
intent=in,out,inout
(dp,ar(nval),in)
description - element number - the total number of values (ndir*nnod*nscalr) - the flux values
output arguments: none Note: If a coupled field, a set of fluxes is stored in the following order (as available): fluid, thermal, electric, magnetic
c c c c c c c c c c
= 0 - return maximum number of local forces on any element (max record length) = DB_NUMDEFINED - return the number of element local forces defined in model output arguments: elfiqr (int,func,out)
subroutine elfdel (ielem) c *** primary function: delete element local forces 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 ielem (int,sc,in) - element number c = 0 - delete for all defined elements c c output arguments: c none. c
2.10.53 emniqr Function (Getting Information About Element Miscellaneous Non-summable Data)
function emniqr (ielem,key) c *** primary function: get information about element misc non-summable c data 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 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 c output arguments: c emniqr (int,func,out) - the returned value of emniqr is based on c setting of key c
c c c c c c c c c c c c c c c c c
siz=sc,ar(n),func
intent=in,out,inout
value
(dp,ar(*),out)
- status of element. = 0 - no non-summed misc data at this element > 0 - number of data items returned - element misc non-summed data. NOTE: the contents of this record is element dependent. See NMISC on ETABLE command
c c c c c c
ielem
(int,sc,in)
c c c c
value
(dp,ar(*),out)
- calculated element current densities. NOTE: current densities are in the order
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 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 c output arguments: c enliqr (int,func,out) - the returned value of enliqr is based on c setting of key
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 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. c c output arguments: c none. c NOTE: Nonlinear data at each node are in the c order SEPL, SRAT, HPRES, EPEQ, PSV, c PLWK, and 4 spares c For beam elements, the contents and c number of information is element c dependent. See NLIN on ETABLE c command c
2.10.65 ehciqr Function (Getting Information About Calculated Element Heat Generations)
function ehciqr (ielem,key) c *** primary function: get information about calculated elem heat generations 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 ielem (int,sc,in) - element number (or zero, see below) c key (int,sc,in) - key as to the information needed
c c c c c c c c c c c c c c
1 - return info about calculated element heat gens for ielem > 0 - return number of heat gens for this element (record length) = 0 - return maximum number of heat gens for any element (max record length) = DB_NUMDEFINED - return the number of calculated element heat generations defined in model output arguments: ehciqr (int,func,out)
c c
none
Argument type is one of the following: 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
cwa
input arguments: variable (typ,siz,intent) description wrcom name key (int,sc,in) = WR_PRINT - print flag (kprint) prtkey wrinqr = 0 - no output = 1 - print = WR_OUTPUT - current output unit number (iott) outfil = WR_MASTEROUT - master output file frstot = WR_COLINTER - interactive columns per page intcol = WR_COLBATCH - batch columns per page batcol = WR_LINEINTER - interactive lines per page intlin = WR_LINEBATCH - batch lines per page batlin = WR_CHARITEM - characters per output item chrper = WR_CHARDECIMAL - characters past decimal chrdec = WR_CHARINTEGER - characters in leading integer chrint = WR_CHARTYPE chrtyp
c c c c c c c c c c c c
= = = = = =
wrinqr = 1 - using E format in output = 2 - using F format in output = 3 - using G format in output WR_SUPTITLE - tlabel supress key WR_SUPSUBTITLE - subtitle supress key WR_SUPLSITER - ls,iter id supress key WR_NOTELINE - note line supress key WR_SUPCOLHEADER - column header supress key WR_SUPCOLMAX - column maximum supress key
co nomore display any more messages (ER_NOMOREMSG) co 0=display messages co 1=display discontinue message and stop displaying co eropen - 0=errors file is closed (ER_FILEOPEN) co 1=errors file is opened co ikserr - 0=if interactive do not set keyerr (ER_INTERERROR) c - 1=if interactive set keyerr (used by mesher and tessalation) co kystat - flag to bypass keyopt tests in the elcxx routines (ER_KEYOPTTEST) c associated with status/panel info inquiries. c 0=do not bypass keyopt tests c 1=perform all keyopt tests co mxr4r5 - mixed rev4-rev5 input logic (*do,*if,*go,*if-go) (ER_MIXEDREV) c (used in chkmix called from rdmac) c 1=rev5 found (*do,*fi-then-*endif) c 2=rev4 found (*go,:xxx,*if,....,:xxx) c 3=warning printed. do not issue any more. co mshkey - cpu intensive meshing etc. this will cause (ER_MESHING) c "nertim (11)" to be set to -1 for "notes", 1 for "warnings", c and 0 for "errors". checking of this key is done in "anserr". c 0=not meshing or cpu intensive c 1=yes, meshing or cpu intensive co syerro - systop error code. read by anserr if set. (18) co opterr - 0=no error in main ansys during opt looping (ER_OPTLOOPING) c 1=an error has happened in main ansys during opt looping co flowrn - flag used by "floqa" as to list floqa.ans (20) c 0=list "floqa.ans" c 1="floqa.ans" has been listed. do not list again. co espare - spare integer variables c c --- end of information from errcom c c output arguments: c erinqr (int,sc,out) - value corresponding to key c #include "impcom.inc" c integer key, erinqr
output arguments:
none
output arguments:
none
c *** Notice - This file contains ANSYS Confidential information *** c c c c c c c c c c c c c c c c c c c c c c c c c c typ=int,dp,log,chr,dcp input arguments: variable (typ,siz,intent) filein (ch*16,sc,in) siz=sc,ar(n) intent=in,out,inout
msgid
msglvl
messg
dperr
cherr
description - Filename used for character portion of message ID (this is the file name of the file which contains the source for this routine) (int,sc,in) - Numeric portion of the message ID 1 - 9999, unique for each erhandler call in the FILE. Recommend using a sequence, similar to format conventions, i.e., 3010, 3020, 3030 (int,sc,in) - level of error (same as anserr) 0=no label (used for u/i pop-ups) -1=no label (used for u/i pop-ups) timed as a note message 1=note, 2=warning, 3=error, 4=fatal (ch*256,sc,in) - error message to display. use keywords of %i %g %c %/ for formating (same as anserr) (dp,ar(*),in) - vector of data to display. contains both integer and double precision data. (same as anserr) (ch*(*),ar(*),in) - vector of character data to display max length of character data is 32 characters vector element. (same as anserr)
Elements)
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 c output arguments: c tr (dp,ar(3,3),in) - transformation matrix c
- vector sum
3.3.3 vmax Function (Retrieving the Maximum Vector Value at a Given Location)
function vmax (v,n,locmax) c *** primary function: return the max value and location in a vector c *** Notice - This file contains ANSYS Confidential information *** c c c c c c input arguments: v (dp,ar(n),in) n (int,sc,in) output arguments: locmax (int,sc,out) vmax (dp,sc,out)
3.3.4 lastv Function (Retrieving the Position of the Last Non-zero Term in a Double Precision Vector)
function lastv (v,n) c *** primary function: find position of last non-zero term in a d.p. vector c c input arguments: c v (dp,ar(n),in) - vector V c n (int,sc,in) - the number of items in the vector C c output arguments: lastv (dp,sc,out)
- zeroed vector
- vector v
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 c c output arguments: c v (dp,ar(inc,n),out) - vector v
- c vector
- a vector
c *** Notice - This file contains ANSYS Confidential information *** c c c c c c c input arguments: a (dp,ar(n),inout) b (dp,ar(n),in) n (int,sc,in) const (dp,sc,in) output arguments: a (dp,ar(n),inout)
- vector a
3.3.15 vamb Subroutine (Gets a Third Vector by Subtracting One Vector from Another)
subroutine vamb (a,b,c,n) c *** primary function: subtract vector b from vector a to get vector c c *** Notice - This file contains ANSYS Confidential information *** c c c c c c input arguments: a (dp,ar(n),in) b (dp,ar(n),in) n (int,sc,in) output arguments: c (dp,ar(n),out)
- vector c
- a vector
c c c c c c
- vector v2
- vector v1
- resulting vector
c *** Notice - This file contains ANSYS Confidential information *** c c c c c c input arguments: iel (int,sc,inout) v (dp,ar(3),inout) output arguments: iel (int,sc,inout) v (dp,ar(3),inout)
subroutine ndpxyz (node,xyz) c *** primary function: store x,y,z vector for a node. c c *** Notice - This file contains ANSYS Confidential information *** c 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) c c output arguments: c none.
- product vector w
subroutine matxv (a,v,w, nr,nc) c *** primary function: multiply vector by full transposed matrix c *** Notice - This file contains ANSYS Confidential information *** c c c c c c c c c c c c c c c input arguments: a (dp,ar(nr,*),in) v (dp,ar(nv),in) nr (int,sc,in)
nc
(int,sc,in)
- matrix a (first dimension must = nr) - vector v (nv must be greater or equal to nr) - first dimension and number of active rows of the untransposed matrix a (also the number of active rows of vector v) - number of columns of the untransposed matrix a (also the number of computed items in the product vector w) if negative, accumulate
- product vector w
c c c c c c c c c
nc n1 n2 n3
number of rows in matrix c number of rows in matrix c to fill number of columns in matrix c to fill number of columns in matrix a and number of rows of matrix b to work with (the two need to be the same for the inner product)
- product matrix c
3.4.6 maat Subroutine (Changing a Matrix Value via Addition, Multiplication, and Transposition)
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 *** Notice - This file contains ANSYS Confidential information *** c c c c c c c c c c c c c c typ=int,dp,log,chr,dcp input arguments: a (dp,ar(*),in) siz=sc,ar(n) intent=in,out,inout
c nc n con
- vector to be multiplied by itself to generate an nxn square matrix (a by a-transposed) (dp,ar(nc,*),inout) - matrix to be accumulated onto (int,sc,in) - number of rows in the c matrix (int,sc,in) - size of square matrix (dp,sc,in) - multiplier on above square matrix
output arguments: c (dp,ar(nc,*),inout) - matrix to be accumulated onto only the lower triangular matrix is done Note: this routine is usually followed by matsym, to do the complete matrix
3.4.7 matsym Subroutine (Filling the Lower Triangle from the Upper Triangle)
subroutine matsym (a,nd,n) c primary function: fill upper triangle from lower triangle c *** Notice - This file contains ANSYS Confidential information *** c c c c c c typ=int,dp,log,chr,dcp siz=sc,ar(n) intent=in,out,inout
input arguments: a (dp,ar(nd,*),inout) - matrix to have copied to its nd (int,sc,in) - number of rows n (int,sc,in) - size of matrix
its lower triangular part upper triangular part of the a matrix to be processed
c c c
output arguments: a (dp,ar(nd,*),inout) - matrix that has its lower triangular part copied to its upper triangular part
c *** Notice - This file contains ANSYS Confidential information *** c c c c c c c c c c c c c c c c input arguments: a (dp,ar(na,na),inout) matrix to be pre and post multiplied (part operated on must be square(nold x nold) and symmetric) na (int,sc,in) first dimension of the a matrix c (dp,ar(nc,nnew),in) matrix to pre and post multiply a by (part used may be rectangular(nold x nnew)) nc (int,sc,in) first dimension of the c matrix nold (int,sc,in) size of part of 'A' matrix that is to be processed(input size). maximum = 64 nnew (int,sc,in) size of part of 'A' matrix that results from this operation(output size). maximum = 64 output arguments: a (dp,ar(na,na),inout) resulting matrix (still square(nnew x nnew) and symmetric).
input arguments: variable (typ,siz,intent) description zs (dp,ar(nz,nz),inout) - matrix to be transformed tr (dp,ar(ntr,ntr),in) - transformation matrix nz (int,sc,in) - dimensioned size of zs matrix ntr (int,sc,in) - dimensioned size of tr matrix nrow (int,sc,in) - number of rows of zs matrix to transform irot (int,sc,in) - block size to transform(size of tr matrix) output arguments: variable (typ,siz,intent) description zs (dp,ar(nz,nz),inout) - transformed matrix
c *** Notice - This file contains ANSYS Confidential information *** c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c typ=int,dp,log,chr,dcp siz=sc,ar(n) intent=in,out,inout
input arguments: variable (typ,siz,intent) description a (dp,ar(nd,*),inout) - matrix to be solved or inverted second dimension must be at least: n + abs(nc) nd (int,sc,in) - first dimension of the a matrix n (int,sc,in) - number of equations nc (int,sc,in) - number of additional columns. if nc = +n or -n, invert n x n matrix and put result in the n+1 to 2xn columns. if nc is 0 or negative, nc will be reset to n and then symeqn will set up identity matrix after the input matrix, where the result of the inversion will be put. if nc is positive and less than n, do a partial inversion. see example 1 below. output arguments: variable (typ,siz,intent) description a (dp,ar(nd,*),inout) - results or inverted matrix. starts in column n+1. note: original information is destroyed. example 1: Solve three simultaneous linear equations: call symeqn (a(1,1),3,3,1) calling routine has a dimensioned as a(3,4) each equation has its 3 coefficents in the first 3 columns, and the constant term is in the fourth column. solution is in fourth column. Invert a 3x3 matrix: call symeqn (a(1,1),3,3,-3) calling routine has a dimensioned as a(3,6) input matrix was input in first 3 columns output matrix in ouput in last 3 columns
example 2:
c c
c c c c c c
msg i r
3.5.5 msgdit Subroutine (Conditionally Printing Messages and a Transposed Integer Matrix)
subroutine msgdit (msg,k,n,m) c *** primary function: write text & transposed integer matrix to output if c 10th debug key is greater than or equal to 3 c c At source development, you may wish conditionally to print-out messages, c scalars, vectors or matrices to monitor the code. Once the program c runs OK, there is no need for these print-outs. This feature can be achieved c with the programmers debug utilities. c c To invoke this utility insert the following line in ANSYS input deck: c c /DEBUG,,, ,,, ,,, ,3 c c *** Notice - This file contains ANSYS Confidential information *** c c input arguments: c variable (typ,siz,intent) description c msg (ch*256,sc,in) - message to print c k (int,ar,in) - integer matrix to print c n (int,sc,in) - row size of vector c m (int,sc,in) - column size of vector c c output arguments: c none
c *** Notice - This file contains ANSYS Confidential information *** c c input arguments: c variable (typ,siz,intent) description c msg (ch*256,sc,in) - message to print c k (int,ar,in) - integer vector to print c n (int,sc,in) - size of vector c c output arguments: c none
c /DEBUG,,, ,,, ,,, ,3 c c *** Notice - This file contains ANSYS Confidential information *** c c input arguments: c variable (typ,siz,intent) description c msg (ch*256,sc,in) - message to print c r (dp,ar,in) - real vector to print c n (int,sc,in) - size of vector c inc (int,sc,in) - increment c c output arguments: c none
3.5.10 msgdrt Subroutine (Conditionally Printing Messages and Real Transposed Matrices)
subroutine msgdrt (msg,r,n,m) c *** primary function: write text & real transposed c debug key is greater than or c c At source development, you may wish conditionally c scalars, vectors or matrices to monitor the code. matrix to output if 10th equal to 3 to print-out messages, Once the program
c runs OK, there is no need for these print-outs. This feature can be achieved c with the programmers debug utilities. c c To invoke this utility insert the following line in ANSYS input deck: c c /DEBUG,,, ,,, ,,, ,3 c c *** Notice - This file contains ANSYS Confidential information *** c c input arguments: c variable (typ,siz,intent) description c msg (ch*256,sc,in) - message to print c r (dp,ar,in) - real matrix to print c n (int,sc,in) - row size of vector c m (int,sc,in) - column size of vector c c output arguments: c none
c is greater than or equal to 3 c c *** secondary function: set debug level c c At source development, you may wish conditionally to print-out messages, c scalars, vectors or matrices to monitor the code. Once the program c runs OK, there is no need for these print-outs. This feature can be achieved c with the programmers debug utilities. c c To invoke this utility insert the following line in ANSYS input deck: c c /DEBUG,,, ,,, ,,, ,3 c c *** Notice - This file contains ANSYS Confidential information *** c c input arguments: c variable (typ,siz,intent) description c msg (ch*256,sc,in) - message to print c c output arguments: c none
Refer to your installation guide for currently supported operating system levels and compilers. This capability is currently not available for any version of Microsoft Windows (note that the presence of compatible compilers and linkers is assumed in these instructions).
Create compilable source code (either in C or FORTRAN). Create a shared library. This is facilitated by the gen_share utility and your system's make capability. Create an external table file (ans_ext.tbl), listing the various shared libraries, each function, and the related command. Set an environment variable pointing to the directory that holds the external table file. This variable must be set before executing ANSYS.
You can create your functions using any of the user-programmable features, database access functions and subroutines, or file access functions provided by ANSYS. (While it is technically feasible to use USR1 through USRn and USER01 through USER10, it is not supported in this release and no examples are provided.) The following are two code segments that demonstrate, at a minimal level, how to create functions that can be used as an entry point into a custom coded shared library. The most important points in the following two examples are:
G G
The C program interface is an integer function that has one argument (a char pointer). The FORTRAN program interface is an interger function that takes an integer argument. (The integer argument is assumed to be the same size as a pointer.)
Note-In the following C example, for the HP/UX platform "icmdan_ " is "icmdan" (no trailing underbar). #include <stdio.h> extern void icmdan_(int*, int[]); extern void writeoutc(char[],int); /* ------------------------------ 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; ----------------------------- End Function Description -------------------*/ int extfnc(char* uecmd) { char *cmdsend = {"/COM, COMMAND SEND FROM extfnc"}; int intsend[80]; int i, ilen; for (i=0;i<80;i++) { intsend[i] = 32; } ilen = 0; for (i=0;(cmdsend[i] != '\0');i++) { intsend[i] = (int)cmdsend[i];
ilen++; } /* Echo back the given external command and its args */ writeoutc(uecmd,1); /* Send ANSYS a comment command */ icmdan_(&ilen,intsend); return(i); }
c------------------------------ Function Description ----------------------c newsub c integer function newsub(i1) c integer i1 c c Purpose: c Demonstrate FORTRAN API entry function for an external command. c c Parameters: c Input c ----------------------------c i1 Not used c Output c ----------------------------c c Return Value: c The return value is ignored by the calling function; c c ----------------------------- End Function Description -------------------c function newsub(i1) c #include "impcom.inc" #include "ansysdef.inc" c external wrinqr, ndinqr integer wrinqr, ndinqr c integer i1, nout, nnodes, newsub c c get output unit number nout = wrinqr(WR_OUTPUT) c c get number of currently defined nodes nnodes = ndinqr(0,DB_NUMDEFINED) c c put out message write (nout,1000) nnodes 1000 format(1x,'I am in newsub. There are ',i12,/, x 'nodes defined in this model.') c newsub = 0 return end
The external table file (ans_ext.tbl) can reside in any directory (but you must specify that directory in the ANSYS_EXTERNAL_TABLE environment variable). The file contains an entry for each shared library function you wish ANSYS to access. There is no limit to the number of entries. The file entries have the following format: /shared/library/path/library.so ~cm_name function_name Where /shared/library/path/library.so Is the path to the directory that contains the shared library file. (Remotely mounted file systems aren't recommended.) ~cm_name Is the 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. 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 and 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 /ansys55/lib/platform directory (where platform is the directory specific to your computing platform, such as /sgi32 or /hppa8000). ANSYS loads external commands in the following order:
G
ANSYS first checks the ans_ext.tbl file in the /ansys55/lib/platform directory and loads any external commands referenced there. ANSYS then loads external commands referenced by the external table file in the directory designated with the ANSYS_EXTERNAL_TABLE environment variable (see section A.2.4).
If you designate a command name that has the same first four characters as a command listed in the /ansys55/lib/platform/ans_ext.tbl file, you won't be able to access your command. Therefore, it's a good practice to check the ANSYS external table file to make sure you have no external command name conflicts. Don't modify the /ansys55/lib/platform/ans_ext.tbl file. You can also use the ~DEBUG command to verify that no external command name conflicts exist. Note-All platforms except for HP-UX use the convention of specifying an underscore (_) as the last character of a FORTRAN function. HP-UX does not require the trailing underscore. Note-The shared library must be consistant with the computer type and OS level on which ANSYS will be executed.
Note that the output lists the command, the related shared library, the function, and if the command has been accessed.
Close all shared libraries Free memory associated with external commands
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.
The following example function can be built into a shared library on your system as a "hello, world" type of test. This example is shown in FORTRAN; however, you can use this as a template for a similar C function. The example exploits two of the functions available to programmers: wrinqr and ndinqr. The related external command will provide a listing of any defined nodes in the output window. subroutine newsub(i1) external wrinqr, ndinqr integer wrinqr, ndinqr integer i1, nout, nnodes c get output unit number nout = wrinqr(WR_OUTPUT) get number of currently defined nodes nnodes = ndinqr(0,DB_NUMDEFINED) put out message write (nout,1000) nnodes 1000 format(1x,'Now in newsub. There are ',i12,/, x 'nodes defined in this model.') return end
You can create a Makefile for this function by issuing the following command: % gen_share ecmd.so You can then build the shared library by issuing % make ecmd.so After you've created your shared library, you can create the external table file with a single entry for that library, function, and command. Remember to set the ANSYS_EXTERNAL_TABLE environment variable to point to the directory that contains the file. Launch ANSYS, enter the /PREP7 processor and create at least one node (N,1,1,1, for example). You can issue the command name that you defined and you should see something like the following in the output window: Now in newsub. There are nodes defined in this model. 1
*** NOTE *** CP= 4.950 TIME= 10:46:23 Command= ~ECMD was processed as an external command which is a non-standard use of the ANSYS program.