-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHolderofMeshes.py
122 lines (82 loc) · 3.98 KB
/
HolderofMeshes.py
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
TrialMesh = Mesh([1, 3, 2])
TrialMesh.create_anchor([0, 0, 0], [0, 0, 0])
TrialMesh.create_anchor([0, 0, 1], [0, 0, 1])
TrialMesh.create_pointmass([0, 1, 1], [0, 1, 1], 1)
TrialMesh.create_pointmass([0, 1, 0], [0, 1, 0], 1)
TrialMesh.create_pointmass([0, 2, 1], [0, 2, 1], 1)
TrialMesh.create_pointmass([0, 2, 0], [0, 2, 0], 1)
TrialMesh.create_spring([0, 0, 1], [0, 1, 1], 1, 1)
TrialMesh.create_spring([0, 0, 0], [0, 1, 0], 1, 1)
TrialMesh.create_spring([0, 1, 1], [0, 1, 0], 1, 1)
TrialMesh.create_spring([0, 1, 1], [0, 2, 1], 1, 1)
TrialMesh.create_spring([0, 1, 0], [0, 2, 0], 1, 1)
TrialMesh.create_spring([0, 2, 1], [0, 2, 0], 1, 1)
Instance1 = Instance(TrialMesh, 0.01, 300)
Instance1.simple_initiate([[0, 1, 0]], [[0, 0, -0.1]], [[0, 1, 0], [0, 1, 1]], [3, 3])
TrialMesh = Mesh([1, 1, 2])
TrialMesh.create_anchor([0, 0, 0], [0, 0, 0])
TrialMesh.create_pointmass([0, 0, 1], [0, 0, 1], 1)
TrialMesh.create_spring([0, 0, 0], [0, 0, 1], 1, 1)
Instance1 = Instance(TrialMesh, 0.001, 10)
Instance1.simple_initiate([[0, 0, 1]], [[0, 0, 0.2]], [[0, 0, 1]], [3])
TrialMesh = Mesh([1, 3, 2])
TrialMesh.create_anchor([0, 0, 0], [0, 0, 0])
TrialMesh.create_anchor([0, 0, 1], [0, 0, 1])
TrialMesh.create_pointmass([0, 1, 1], [0, 1, 1], 1)
TrialMesh.create_pointmass([0, 1, 0], [0, 1, 0], 1)
TrialMesh.create_pointmass([0, 2, 1], [0, 2, 1], 1)
TrialMesh.create_pointmass([0, 2, 0], [0, 2, 0], 1)
TrialMesh.create_rest_spring([0, 0, 1], [0, 1, 1], 1)
TrialMesh.create_rest_spring([0, 0, 0], [0, 1, 0], 1)
TrialMesh.create_rest_spring([0, 1, 1], [0, 1, 0], 1)
TrialMesh.create_rest_spring([0, 1, 1], [0, 2, 1], 1)
TrialMesh.create_rest_spring([0, 1, 0], [0, 2, 0], 1)
TrialMesh.create_rest_spring([0, 2, 1], [0, 2, 0], 1)
Instance1 = Instance(TrialMesh, 0.01, 10)
Instance1.initialize_tracking([[0, 1, 0], [0, 1, 1]], [3, 3])
Instance1.initialize_displacement([[0, 1, 0], [0, 1, 1]], [[0, 0, -0.2], [0, 0, 0.2]])
Instance1.simulate()
TrialMesh = Mesh([1, 3, 2])
TrialMesh.create_anchor([0, 0, 0], [0, 0, 0])
TrialMesh.create_anchor([0, 0, 1], [0, 0, 1])
TrialMesh.create_pointmass([0, 1, 1], [0, 1, 1], 1)
TrialMesh.create_pointmass([0, 1, 0], [0, 1, 0], 1)
TrialMesh.create_pointmass([0, 2, 1], [0, 2, 1], 1)
TrialMesh.create_pointmass([0, 2, 0], [0, 2, 0], 1)
TrialMesh.create_rest_spring([0, 0, 1], [0, 1, 1], 1)
TrialMesh.create_rest_spring([0, 0, 0], [0, 1, 0], 1)
TrialMesh.create_rest_spring([0, 1, 1], [0, 1, 0], 1)
TrialMesh.create_rest_spring([0, 1, 1], [0, 2, 1], 1)
TrialMesh.create_rest_spring([0, 1, 0], [0, 2, 0], 1)
TrialMesh.create_rest_spring([0, 2, 1], [0, 2, 0], 1)
Instance1 = Instance(TrialMesh, 0.01, 25)
Instance1.initialize_tracking([[0, 0, 0], [0, 1, 0], [0, 2, 0]], [2, 2, 2])
Instance1.initialize_displacement([[0, 1, 0], [0, 1, 1]], [[0, 0, -0.3], [0, 0, 0.3]])
Instance1.simulate()
Instance1.graph_motion()
Instance1.graph_energy()
#Simple Pratt Truss
TrialMesh = Mesh([1, 2, 4])
TrialMesh.create_anchor([0, 0, 0], [0, 0, 0])
TrialMesh.create_anchor([0, 0, 3], [0, 0, 3])
TrialMesh.create_pointmass([0, 0, 1], [0, 0, 1], 1)
TrialMesh.create_pointmass([0, 0, 2], [0, 0, 2], 1)
TrialMesh.create_pointmass([0, 1, 1], [0, 1, 1], 1)
TrialMesh.create_pointmass([0, 1, 2], [0, 1, 2], 1)
TrialMesh.create_rest_spring([0, 0, 0], [0, 0, 1], 100)
TrialMesh.create_rest_spring([0, 0, 0], [0, 1, 1], 100)
TrialMesh.create_rest_spring([0, 0, 1], [0, 1, 1], 100)
TrialMesh.create_rest_spring([0, 0, 1], [0, 0, 2], 100)
TrialMesh.create_rest_spring([0, 0, 1], [0, 1, 2], 100)
TrialMesh.create_rest_spring([0, 1, 1], [0, 0, 2], 100)
TrialMesh.create_rest_spring([0, 1, 1], [0, 1, 2], 100)
TrialMesh.create_rest_spring([0, 0, 2], [0, 1, 2], 100)
TrialMesh.create_rest_spring([0, 0, 2], [0, 0, 3], 100)
TrialMesh.create_rest_spring([0, 1, 2], [0, 0, 3], 100)
Instance1 = Instance(TrialMesh, 0.01, 20)
Instance1.initialize_tracking([[0, 0, 1]], [2])
Instance1.initialize_static_load([[0, 0, 1], [0, 0, 2]], [[0, -1, 0], [0, -1, 0]])
Instance1.simulate()
Instance1.graph_motion()
Instance1.graph_energy()
Instance1.simple_fourier()