forked from bguest/ansys-macros
-
Notifications
You must be signed in to change notification settings - Fork 0
/
P26PsdSMISC.mac
84 lines (75 loc) · 2.05 KB
/
P26PsdSMISC.mac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
!P26PSDAccl.mac
!B.GUEST: bagvoo@gmail.com
!DESCRIPTION: This macro plots and acceleration PSD
! curve given a node
!PRECONDITIONS:
! ARG1 = SMICS NUMBER
! ELSE user is prompted to pick SMCIS number
! ARG2 = Element for data
! ELSE user is prompted to pick element
! ARG3 = Reference number of resulting variable
! ELSE reference number of resulting variable = 5
! ARG4 = Points per frequency
! ELSE Pts per frequency = 5
!POSTCONDITIONS:
! PLOT OF PSD is displayed on screen
! PSD curve is output to file "OUT_P26Smisc.out"
!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
!------------------------------------SAVE CURRENT SETUP
CM,tempElem,ELEM
!----------------------------------------------GET NODE
*IF,ARG1,EQ,0,THEN
*ASK,smiscNum,SMISC NUMBER,1
*ELSE
smiscNum=ARG1
*ENDIF
!-----------------------------------------GED DIRECTION
*IF,ARG2,EQ,0,THEN
*MSG,UI
SELECT Element
ESEL,R,p
*GET,elemNum,ELEM,,NUM,MAX
CMSEL,S,tempElem
*ELSE
elemNum=ARG2
*ENDIF
!--------------------------Resulting Reference Variable
IAsmisc = 2 !REFERENCE NUMBER OF VARIBLE TO BE OPERATED ON
*IF,ARG3,EQ,0,THEN
IRsmisc = 5
*ELSE
IRsmisc = ARG3
*ENDIF
!-------------------------------------PTS Per Frequency
*IF,ARG4,EQ,0,THEN
FrqPts = 5
*ELSE
FrqPts = ARG4
*ENDIF
!================== PSD POST-PROCESSING ===============
/GROPT,LOGX,ON
/GROPT,LOGY,ON
set,3,1
! Calculate Response PSD
/POST26 ! Enter POST26
STORE,PSD,FrqPts ! Store frequency vector (variable 1)
NUMVAR,200
ESOL, IAsmisc,elemNum,NELEM(elemNum,1),SMISC,smiscNum, 'psdSMISC'
STORE,MERGE
RPSD, IRsmisc, IAsmisc, ,, 1, 'Resp psdSMISC'
PLVAR,IRsmisc !Plot
!------------------------PRINT
*GET,NUM_PTS,VARI,,NSETS
HZ= $ *DIM,HZ,ARRAY,NUM_PTS
FResp= $ *DIM,FResp,ARRAY,NUM_PTS
VGET,HZ,1,0.0
VGET,FResp,IRsmisc,0.0
*CFOPEN,OUT_P26Smisc,out
*VWRITE,HZ(1),FResp(1),
(E15.5,E15.5)
*CFCLOS
_FRONT
_FIT
!======THE--END========THE--END========THE--END========
!ITS THE END OF THE MACRO AS WE KNOW IT AND I FEEL FINE