-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontact_KC_plot.mac
126 lines (110 loc) · 5.18 KB
/
contact_KC_plot.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
!$contact_obj:t=contact:C=1
!$Analysis:t=analysis:C=1
!$New_plot_name: t=string: C=1: D=advanced_contact_plot
def com echo=on
! ----------------
! Collate Contacts
! ----------------
! NOTE: This combines multiple contact tracks into one
analysis collate_contacts &
analysis=$Analysis &
contact=$contact_obj
var set var=sep_str string='.'
! Check if plot name already exists and add an incremental suffix if needed
if condition = (DB_EXISTS(eval("."//"$New_plot_name")))
variable set &
variable_name = plotname &
string = (UNIQUE_NAME(eval("$New_plot_name")))
else
variable set &
variable_name = plotname &
string = (eval("$New_plot_name"))
end
! -----------
! Create Plot
! -----------
xy_plot template create plot=(eval("."//plotname)) &
title = (eval("$New_plot_name")) &
auto_subtitle=yes &
auto_date=yes &
auto_analysis_name=yes &
table=no
! -----------------------------
! FLEX-TO-FLEX OR FLEX-TO-SOLID
! -----------------------------
if condition = (eval($contact_obj.type)=="8"||eval($contact_obj.type)=="7")
! Find i_flex contact nodes
variable set &
variable_name = contact_nodes &
object = (eval(DB_DESCENDANTS(STOO($Analysis//"."//STR_SPLIT($contact_obj,sep_str)[3]//"."//STR_SPLIT($contact_obj.i_flex,sep_str)[3]),"result_set",1,1 )))
variable set &
variable_name = node_count &
integer = (eval(rows(contact_nodes)))
! Add Curves
xy_plot curve create curve=(eval("."//plotname//".total_force")) &
create_page=no &
calculate_axis_limits=no &
y_expression=(eval(node_count//"*"//$contact_obj//".stiffness*abs("//contact_nodes[1]//".penetration.depth)**"//$contact_obj//".exponent-"//node_count//"*"//"STEP(abs("//contact_nodes[1]//".penetration.depth),0,0,"//$contact_obj//".dmax,"//$contact_obj//".damping)*"//contact_nodes[1]//".penetration.velocity")) &
x_expression=(eval($Analysis.TIME)) &
y_units = "force" &
x_units = "time"
plotcurve3d curve modify curve=(eval("."//plotname//".total_force")) legend="total_force"
xy_plot curve create curve=(eval("."//plotname//".stiffness_force")) &
create_page=no &
calculate_axis_limits=no &
y_expression=(eval(node_count//"*"//$contact_obj//".stiffness*abs("//contact_nodes[1]//".penetration.depth)**"//$contact_obj//".exponent")) &
x_expression=(eval($Analysis.TIME)) &
y_units = "force" &
x_units = "time"
plotcurve3d curve modify curve=(eval("."//plotname//".stiffness_force")) legend="stiffness_force"
xy_plot curve create curve=(eval("."//plotname//".damping_force")) &
create_page=no &
calculate_axis_limits=no &
y_expression=(eval(node_count//"*"//"-STEP(abs("//contact_nodes[1]//".penetration.depth),0,0,"//$contact_obj//".dmax,"//$contact_obj//".damping)*"//contact_nodes[1]//".penetration.velocity")) &
x_expression=(eval($Analysis.TIME)) &
y_units = "force" &
x_units = "time"
plotcurve3d curve modify curve=(eval("."//plotname//".damping_force")) legend="damping_force"
variable delete &
variable_name = contact_nodes
variable delete &
variable_name = node_count
! --------------
! SOLID-TO-SOLID
! --------------
elseif condition = (eval($contact_obj.type)=="0")
! Add Curves
xy_plot curve create curve=(eval("."//plotname//".total_force")) &
create_page=no &
calculate_axis_limits=no &
y_expression=(eval($contact_obj//".stiffness*ABS("//$Analysis//"."//STR_SPLIT($contact_obj,sep_str)[3]//".TRACK_1.Penetration.Depth)**"//$contact_obj//".exponent-STEP(abs("//$Analysis//"."//STR_SPLIT($contact_obj,sep_str)[3]//".TRACK_1.Penetration.Depth),0,0,"//$contact_obj//".dmax,"//$contact_obj//".damping)*"//$Analysis//"."//STR_SPLIT($contact_obj,sep_str)[3]//".TRACK_1.Penetration.velocity")) &
x_expression=(eval($Analysis.TIME)) &
y_units = "force" &
x_units = "time"
plotcurve3d curve modify curve=(eval("."//plotname//".total_force")) legend="total_force"
xy_plot curve create curve=(eval("."//plotname//".stiffness_force")) &
create_page=no &
calculate_axis_limits=no &
y_expression=(eval($contact_obj//".stiffness*(-1*"//$Analysis//"."//STR_SPLIT($contact_obj,sep_str)[3]//".TRACK_1.Penetration.Depth)**"//$contact_obj//".exponent")) &
x_expression=(eval($Analysis.TIME)) &
y_units = "force" &
x_units = "time"
plotcurve3d curve modify curve=(eval("."//plotname//".stiffness_force")) legend="stiffness_force"
xy_plot curve create curve=(eval("."//plotname//".damping_force")) &
create_page=no &
calculate_axis_limits=no &
y_expression=(eval("-1*STEP(abs("//$Analysis//"."//STR_SPLIT($contact_obj,sep_str)[3]//".TRACK_1.Penetration.Depth),0,0,"//$contact_obj//".dmax,"//$contact_obj//".damping)*"//$Analysis//"."//STR_SPLIT($contact_obj,sep_str)[3]//".TRACK_1.Penetration.velocity")) &
x_expression=(eval($Analysis.TIME)) &
y_units = "force" &
x_units = "time"
plotcurve3d curve modify curve=(eval("."//plotname//".damping_force")) legend="damping_force"
end
! -----------
! Format Plot
! -----------
xy_plots template &
auto_zoom &
plot_name=(eval("."//plotname))
xy_plot template &
calculate_axis_limits &
plot_name=(eval("."//plotname))