Sheldon’s ansys.net Tips Compiling UPFs
3.1 APDL vs. UPFs
While this may sound trivial, there have been many situations where usershave mistakenly thought that UPFs were required for tasks that are easierto perform using APDL. While APDL can be thought of as a scripting lan-guage that may be slower to execute than compiled code, APDL has vectorfunctions that speed up tasks considerably. Moreover, changing/adjustingAPDL input files is much easier than modifying subroutines and recompil-ing/relinking. Hence, the user should consider whether or not the desiredfunctionality can be achieved with APDL, as that would generally be a mucheasier, quicker approach than implementing UPFs.
3.2 Determining the Right Subroutine to Use
In Reference[2], there are many subroutines to choose from, and some may
seem to provide duplicate functionality with other subroutines. There aresome legacy subroutines available for users who may wish, for one reasonor another, to stick with older elements or older features. The “newer”subroutines are typically associated with the current-technology elements.
For example, to define one’s own nonlinear constitutive model, considerusing
USERMAT.F
instead of
USERPL.F
.
3.3 Compiling and Linking UPFs
Example UPFs are provided in the “user” folder of the “custom” (Win-dows) or “customize” (Linux) subdirectories. Also with the example UPFsis a script called
ANSCUSTOM
(
ANSCUST.BAT
on Windows) that facilitates link-ing/compiling. Before running that script, it is important to note
ANSCUSTOM
on any operating system needs to know (a) where the compiling/linking ex-ecutables reside, (b) where system “include” files are located, and (c) where“libraries” are located. These are usually achieved through the definition of the PATH, INCLUDE, and LIB environment variables.All of the user subroutines are in the same folder, so if the user decidesto compile in the “user” folder, compiling may take a while since all usersubroutines will be compiled and linked together.
The author prefers either
5
Current technology elements include
LINK180
,
BEAM188-189
,
SHELL181/281
,
SHELL208-209
,
SOLSH190
,
SOLID185-187
, and
PLANE182/183
. At ANSYS 12.0, elements
SOLID272-273
,
SOLID285
,
PIPE288-289
, and
ELBOW290
will be added to this list.
6
At ANSYS 12.0, the design may be changed on the Windows platform such thatexample subroutines are in one folder and the
ANSCUST.BAT
script in a separate folder toprevent this behavior.
3
Add a Comment