forked from bguest/ansys-macros
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAMPC.mac
78 lines (70 loc) · 2.05 KB
/
AMPC.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
/pmacro
!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
!AMPC.mac
!DESCRIPTION: This macro creates a "Spider Web" of
! MPCs from a Node to an area or areas
!PRECONDITIONS:
! ARG1 = Node for Spiderweb Center
! ELSE: User is requested to enter Node
! ARG2 = First Area OR <0 for ALL Selected Areas
! ARG3 = Constraint Type
! 0 --> Rigid Link (3DOF Constrained per Node)
! 1 --> Rigid Beam (6DOF Constrained per Node)
! ARG4 = Constraint Type
! 0 --> Direct Elimination Method
! 1 --> Lagrange Multiplier Method
!POSTCONDITIONS:
! Elements Created / Modified:
! Element type 997 = MPC184
! See Description...
!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
PARSAV,ALL,F:\_ANSYS\TEMP\AMPC.txt !Save Parameters
CM,temp_node,NODE
CM,temp_area,AREA
!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
!MATERIALS
!======================================================
MatNum = 997-1*ARG3-2*ARG4 !MPC184: Rigid Link
!------------------------------------------------------
ET,MatNum,MPC184
KEYOPT,MatNum,1,1-ARG3 !LINK / BEAM
KEYOPT,MatNum,2,ARG4 !Constraitn TYpe
R,MatNum !No Real Constants
MP,ALPX,MatNum,0.0 !CTE
!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
!GET MASTER KEYPOINT
*IF,ARG1,EQ,0,THEN
*MSG,UI
Select Master Node
NSEL,R,P
*GET,masterNode,Node,O,NUM,MAX !Get Highest Selected KP
*ELSE,ARG1,GT,0,THEN
masterNode = ARG1
*ENDIF
!GET AREAS
*IF,ARG2,EQ,0,THEN
*MSG,UI
Select Areas
ASEL,R,P
*ELSEIF,ARG2,GT,0,THEN
ASEL,S,,,ARG2
*ENDIF !ELSE ASSUME AREAS ARE SELECTED
!Get List of Nodes on Surface
NSLA,S,1 !Select Nodes
NSEL,U,,,masterNode
*GET,countNodes,NODE,,Count
nodeNum= $ *VGET,nodeNum,NODE,,NLIST
!Create Spider Web
NSEL,A,,,masterNode !Reselect MasterNode
ATT,997
*do,i,1,countNodes
NDIST,masterNode,nodeNum(i) !MAKE SURE ELEMENT HAS
*IF,_return,GT,0,THEN !^Length
E,masterNode,nodeNum(i)
*ENDIF
*ENDDO
CMSEL,A,temp_Area
CMSEL,A,temp_Node
PARRES,,F:\_ANSYS\TEMP\AMPC.txt !Resume Saved Parameters
!======THE--END========THE--END========THE--END========
!ITS THE END OF THE MACRO AS WE KNOW IT AND I FEEL FINE