You can access the logic just before a run begins or just after a run ends, and at many other intermediate points, by using the subroutines listed below. These subroutines can perform actions such as evaluating results or performing calculations. (None of the subroutines have input or output arguments.)
Issue the USRCAL command (or use an equivalent menu path) to activate or deactivate these subroutines.
User Subroutine | Is Called |
---|---|
UAnBeg [1] | At start-up |
USolBeg | Before solution |
ULdBeg | Before a load step |
USsBeg | Before a substep |
UItBeg | Before an iteration |
UItFin | After an iteration |
USsFin | After a substep |
ULdFin | After a load step |
USolFin | After solution |
UAnFin | At the end of a run |
The
UAnBeg
subroutine that allows user access at the start of a run does not require activation by the USRCAL command; it is automatically activated when the program is started.
Subroutines USSBeg
, UItBeg
,
UItFin
and USSFin
default to reading a
command macro file from the current working directory whose name is
subroutine.mac (that is, ussfin.mac is
read by USSFin.F). No user action to relink the 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 commands is limited. Commands which are known to work include
*DIM, *STATUS. Commands which require another
line (*MSG, *VWRITE) are not allowed. Other
commands which are known to not work are the solution loading commands
(D, F, SFE, and so on). If
these capabilities are required, the user will need to create a FORTRAN subroutine and
link this subroutine into the program, as described in Understanding User-Programmable Features (UPFs).
While parameter substitution into commands is not permitted, USSBeg
, and so on were
designed to be used in conjunction with dynamic tables and parameter substitution from the user subroutine.
As an example, consider a table defined as d5 = f(par1), If d5 contains values of displacement as a function
of PAR1, then d5 may be used as a constraint, as
*dim,d5,table,10,1,1,PAR1 d5(1)=0,.1,.25, /solu d,5,ux,%d5%
Modify the value of PAR1 in USSBeg.MAC and the constraint on node 5, ux can then be modified in the middle of a load step.
The following is an example of a valid input that may be read by USSBeg
,
UItBeg
, UItFin
and USSFin
.
/COM, SAMPLE ussfin.mac a=5 b=nx(1) ! *get function is ok *get,c,active,solu,Time,cpu ! *get is ok *dim,array,,6 ! array parameters are ok array(1) = 1 array(2) = 2 array(3) = 3 array(4) = 4 array(5) = 5 array(6) = 6 *vleng,3 ! vector operations are ok *vfun,array(4),copy,array(1) *stat *stat,array(1) array(1)= nnode = ndinqr(0,14) *dim,array,,nnode *vget,array(1),NODE,1,NSEL *stat,array(1) array(1)= /eof /COM, COMMANDS BELOW THIS LINE ARE KNOWN TO NOT WORK p,1,6,2000 ! commands DO NOT work d,1,uy,.1 *msg,note THIS IS A TEST MESSAGE *vwrite,array(1) (/ b = ,f10.4)