Skip to content

Commit 75b3bb5

Browse files
committed
necessary assets
0 parents  commit 75b3bb5

22 files changed

+62831
-0
lines changed

LevelSets/bowl.vdb

573 KB
Binary file not shown.

LevelSets/sphere.vdb

810 KB
Binary file not shown.

MpmParticles/particles-1000k.dat

12.4 MB
Binary file not shown.

Regression/cloth.lua

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
-- mpm 3f
2+
math.randomseed(123)
3+
4+
output = "output/cloth"
5+
end_frame = 10
6+
dx = 0.2
7+
cloth_dx = 0.2
8+
gravity = TV.create({0, -3,0})
9+
max_dt = 0.001
10+
apic_rpic_ratio = 0.2
11+
cfl = 0.3
12+
element_partitions = 16
13+
14+
quasistatic = false
15+
symplectic = true
16+
matrix_free = true
17+
verbose = false
18+
run_diff_test = false
19+
write_meshes = false
20+
write_partio = false
21+
22+
use_bending = false
23+
bending_Youngs = 6e-4
24+
Youngs = 400
25+
nu = 0.3
26+
rho = 2
27+
cloth_k = 800
28+
cloth_gamma = 0
29+
cloth_friction_angle = 0
30+
cloth_damage = 999999
31+
32+
function initialize(frame)
33+
34+
create_cloth(TV.create({0, 0,0}))
35+
36+
-- pinner
37+
local sphere_center = TV.create({-1, 0.5,-0.5})
38+
local sphere = Sphere.new(sphere_center, 0.1)
39+
local sphere_object = AnalyticCollisionObject.new(sphere, STICKY)
40+
mpm:addAnalyticCollisionObject(sphere_object)
41+
42+
local sphere_center = TV.create({-1, 0.5,0.5})
43+
local sphere = Sphere.new(sphere_center, 0.1)
44+
local sphere_object = AnalyticCollisionObject.new(sphere, STICKY)
45+
mpm:addAnalyticCollisionObject(sphere_object)
46+
47+
-- bullet
48+
local sphere_center = TV.create({-0.8, 0 ,0})
49+
local sphere = Sphere.new(sphere_center, 0.25)
50+
local sphere_object = AnalyticCollisionObject.new(sphere, SEPARATE)
51+
mpm:addAnalyticCollisionObject(sphere_object)
52+
53+
-- bullet2
54+
local sphere_center = TV.create({2.5, 0 ,0})
55+
local sphere = Sphere.new(sphere_center, 0.25)
56+
local sphere_object = AnalyticCollisionObject.new(sphere, SEPARATE)
57+
mpm:addAnalyticCollisionObject(sphere_object)
58+
59+
local ground_origin = TV.create({0,0,0})
60+
local ground_normal = TV.create({0,1,0})
61+
local ground_ls = HalfSpace.new(ground_origin, ground_normal)
62+
local ground_object = AnalyticCollisionObject.new(ground_ls, SEPARATE)
63+
ground_object:setFriction(0.1)
64+
mpm:addAnalyticCollisionObject(ground_object)
65+
end
66+
67+
function create_cloth(t)
68+
local transform = t;
69+
function cloth(index, mass, X, V)
70+
X[1], X[2] = -X[2], X[1]
71+
X[0] = X[0] - 1
72+
X[1] = X[1] + 0.5
73+
X[2] = X[2] - 0.5
74+
X:set(X + transform)
75+
end
76+
77+
local mesh = scene:createTriMesh(constructUnitSquare)
78+
local deformable = scene:addDeformableTriMesh(mesh)
79+
deformable:transform(cloth)
80+
81+
local meshed_particles_handle = mpm:makeParticleHandle(deformable, 1)
82+
local thickness = 0.001
83+
local quadrature_count = 1
84+
local quadrature_particles_handle = mpm:sampleTriParticles(deformable, thickness, rho, quadrature_count)
85+
local m = QRCloth3D.new(Youngs,nu, cloth_k, cloth_gamma)
86+
quadrature_particles_handle:addFBasedMpmForce(m)
87+
local py = ClothYield.new(cloth_friction_angle, cloth_damage)
88+
quadrature_particles_handle:addPlasticity(m,py,"cotangent")
89+
90+
if(use_bending==true) then
91+
local bending_mesh = mpm:addBendingSpringsForTriangles(deformable)
92+
local bending_deformable = scene:addDeformableSegMesh(bending_mesh)
93+
local m_bending = CorotatedCodimensional1.new(bending_Youngs,0.3)
94+
bending_deformable:addFemHyperelasticForce(m_bending)
95+
end
96+
97+
end
98+
99+
function constructUnitSquare(mesh, X)
100+
local z = TV2.create({0, 0})
101+
local cells = IntV2.create({2/cloth_dx, 1/cloth_dx})
102+
local grid = Grid2d.new(cells, cloth_dx , z);
103+
construct2dMattressMesh(grid, mesh, X)
104+
end

Regression/cloth_restart_10.dat

42.9 KB
Binary file not shown.

Regression/mattress.lua

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
output = "output/mattress"
2+
end_frame = 10
3+
E = 100
4+
rho = 1
5+
nu = 0.3
6+
m = 10
7+
gravity = TV.create({0, -9.8, 0})
8+
max_dt = 0.004
9+
newton_iterations = 100
10+
11+
function initialize(frame)
12+
local mesh = scene:createTetMesh(constructUnitBox)
13+
local deformable = scene:addDeformableTetMesh(mesh)
14+
deformable:setMassFromDensity(rho)
15+
local m = Corotated.new(E,nu)
16+
deformable:addFemHyperelasticForce(m)
17+
scene:setBoundaryConditions(left_side)
18+
end
19+
20+
function constructUnitBox(mesh, X)
21+
local z = TV.create({0, 0, 0})
22+
23+
local cells = IntV.create({m, m, m})
24+
25+
local grid = Grid3d.new(cells, 1/m, z);
26+
construct3dMattressMesh(grid, mesh, X)
27+
end
28+
29+
function left_side(dof, X)
30+
return X[0] < 1e-9
31+
end

Regression/mattress_restart_10.dat

1.57 MB
Binary file not shown.

SegMesh/knot1.poly

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
POINTS
2+
1: -0.222713 -0.376456 -0.0881813
3+
2: -0.224054 -0.375756 -0.0929176
4+
3: -0.225394 -0.375057 -0.0976538
5+
4: -0.226735 -0.374357 -0.10239
6+
5: -0.228076 -0.373657 -0.107126
7+
6: -0.229416 -0.372958 -0.111863
8+
7: -0.230757 -0.372258 -0.116599
9+
8: -0.232098 -0.371558 -0.121335
10+
9: -0.23293 -0.36921 -0.124079
11+
10: -0.232958 -0.364255 -0.123672
12+
11: -0.232985 -0.359299 -0.123266
13+
12: -0.233013 -0.354344 -0.12286
14+
13: -0.233041 -0.349389 -0.122453
15+
14: -0.233069 -0.344434 -0.122047
16+
15: -0.233097 -0.339479 -0.121641
17+
16: -0.233125 -0.334524 -0.121235
18+
17: -0.233152 -0.329569 -0.120828
19+
18: -0.23318 -0.324614 -0.120422
20+
19: -0.233219 -0.319663 -0.120019
21+
20: -0.236785 -0.316257 -0.120649
22+
21: -0.240351 -0.31285 -0.121279
23+
22: -0.243918 -0.309444 -0.121909
24+
23: -0.247484 -0.306038 -0.122538
25+
24: -0.25105 -0.302631 -0.123168
26+
25: -0.254617 -0.299225 -0.123798
27+
26: -0.258183 -0.295818 -0.124428
28+
27: -0.26175 -0.292412 -0.125058
29+
28: -0.265316 -0.289006 -0.125688
30+
29: -0.268882 -0.285599 -0.126318
31+
30: -0.272657 -0.282764 -0.127018
32+
31: -0.277512 -0.282892 -0.128082
33+
32: -0.282367 -0.283021 -0.129146
34+
33: -0.287222 -0.28315 -0.13021
35+
34: -0.292076 -0.283278 -0.131275
36+
35: -0.296931 -0.283407 -0.132339
37+
36: -0.301786 -0.283536 -0.133403
38+
37: -0.306641 -0.283664 -0.134467
39+
38: -0.311496 -0.283793 -0.135531
40+
39: -0.316351 -0.283921 -0.136596
41+
40: -0.321206 -0.28405 -0.13766
42+
41: -0.326061 -0.284179 -0.138724
43+
42: -0.330916 -0.284307 -0.139788
44+
43: -0.335771 -0.284436 -0.140852
45+
44: -0.340626 -0.284565 -0.141916
46+
45: -0.34548 -0.284693 -0.142981
47+
46: -0.349794 -0.28613 -0.144018
48+
47: -0.353306 -0.289504 -0.145016
49+
48: -0.356819 -0.292879 -0.146014
50+
49: -0.360331 -0.296254 -0.147012
51+
50: -0.363843 -0.299628 -0.14801
52+
51: -0.367355 -0.303003 -0.149008
53+
52: -0.370867 -0.306378 -0.150006
54+
53: -0.374379 -0.309752 -0.151004
55+
54: -0.377891 -0.313127 -0.152002
56+
55: -0.381404 -0.316501 -0.153
57+
56: -0.384916 -0.319876 -0.153998
58+
57: -0.388428 -0.323251 -0.154996
59+
58: -0.39194 -0.326625 -0.155995
60+
59: -0.395452 -0.33 -0.156993
61+
60: -0.397833 -0.333832 -0.157887
62+
61: -0.397527 -0.338752 -0.158533
63+
62: -0.39722 -0.343672 -0.15918
64+
63: -0.396914 -0.348592 -0.159827
65+
64: -0.396607 -0.353512 -0.160473
66+
65: -0.396301 -0.358433 -0.16112
67+
66: -0.395995 -0.363353 -0.161767
68+
67: -0.395688 -0.368273 -0.162413
69+
68: -0.395382 -0.373193 -0.16306
70+
69: -0.395075 -0.378113 -0.163707
71+
70: -0.394769 -0.383033 -0.164353
72+
71: -0.394462 -0.387953 -0.165
73+
72: -0.394156 -0.392873 -0.165647
74+
73: -0.39052 -0.395974 -0.165397
75+
74: -0.386485 -0.398856 -0.16504
76+
75: -0.382449 -0.401738 -0.164683
77+
76: -0.378414 -0.404621 -0.164326
78+
77: -0.374379 -0.407503 -0.163969
79+
78: -0.370344 -0.410386 -0.163612
80+
79: -0.366308 -0.413268 -0.163255
81+
80: -0.362273 -0.41615 -0.162898
82+
81: -0.358238 -0.419033 -0.162542
83+
82: -0.354202 -0.421915 -0.162185
84+
83: -0.350167 -0.424798 -0.161828
85+
84: -0.346132 -0.42768 -0.161471
86+
85: -0.342097 -0.430562 -0.161114
87+
86: -0.338061 -0.433445 -0.160757
88+
87: -0.33393 -0.43575 -0.160266
89+
88: -0.32924 -0.434694 -0.158997
90+
89: -0.324551 -0.433639 -0.157728
91+
90: -0.319861 -0.432583 -0.156459
92+
91: -0.315171 -0.431527 -0.15519
93+
92: -0.310481 -0.430471 -0.153921
94+
93: -0.305792 -0.429415 -0.152652
95+
94: -0.301102 -0.428359 -0.151383
96+
95: -0.296412 -0.427303 -0.150114
97+
96: -0.291722 -0.426247 -0.148845
98+
97: -0.287033 -0.425191 -0.147576
99+
98: -0.282343 -0.424135 -0.146307
100+
99: -0.277653 -0.42308 -0.145038
101+
100: -0.272963 -0.422024 -0.143769
102+
101: -0.268273 -0.420968 -0.1425
103+
102: -0.263584 -0.419912 -0.141231
104+
103: -0.258894 -0.418856 -0.139962
105+
104: -0.254204 -0.4178 -0.138693
106+
105: -0.249514 -0.416744 -0.137424
107+
106: -0.244825 -0.415688 -0.136155
108+
107: -0.240135 -0.414632 -0.134885
109+
108: -0.237345 -0.411457 -0.133236
110+
109: -0.235507 -0.407219 -0.131396
111+
110: -0.233669 -0.402982 -0.129556
112+
111: -0.23183 -0.398745 -0.127716
113+
112: -0.229992 -0.394508 -0.125876
114+
113: -0.228154 -0.390271 -0.124036
115+
114: -0.226316 -0.386033 -0.122196
116+
115: -0.224477 -0.381796 -0.120356
117+
116: -0.222639 -0.377559 -0.118516
118+
117: -0.220801 -0.373321 -0.116676
119+
118: -0.220964 -0.368748 -0.115964
120+
119: -0.22234 -0.36397 -0.115937
121+
120: -0.223716 -0.359193 -0.11591
122+
121: -0.225092 -0.354415 -0.115883
123+
122: -0.226468 -0.349638 -0.115856
124+
123: -0.227844 -0.34486 -0.115829
125+
124: -0.22922 -0.340083 -0.115802
126+
125: -0.230596 -0.335305 -0.115775
127+
126: -0.231972 -0.330527 -0.115748
128+
127: -0.233348 -0.32575 -0.115721
129+
128: -0.235573 -0.321554 -0.115805
130+
129: -0.239507 -0.31853 -0.116111
131+
130: -0.243441 -0.315505 -0.116418
132+
131: -0.247375 -0.31248 -0.116724
133+
132: -0.251309 -0.309455 -0.11703
134+
133: -0.255243 -0.306431 -0.117337
135+
134: -0.259177 -0.303406 -0.117643
136+
135: -0.263111 -0.300381 -0.11795
137+
136: -0.267045 -0.297356 -0.118256
138+
137: -0.270979 -0.294332 -0.118562
139+
138: -0.275127 -0.291993 -0.119003
140+
139: -0.280016 -0.292028 -0.119909
141+
140: -0.284904 -0.292062 -0.120814
142+
141: -0.289793 -0.292097 -0.12172
143+
142: -0.294681 -0.292132 -0.122626
144+
143: -0.29957 -0.292167 -0.123531
145+
144: -0.304458 -0.292202 -0.124437
146+
145: -0.309347 -0.292237 -0.125342
147+
146: -0.314235 -0.292271 -0.126248
148+
147: -0.319124 -0.292306 -0.127154
149+
148: -0.324013 -0.292341 -0.128059
150+
149: -0.328901 -0.292376 -0.128965
151+
150: -0.33379 -0.292411 -0.129871
152+
151: -0.338678 -0.292445 -0.130776
153+
152: -0.343567 -0.29248 -0.131682
154+
153: -0.348455 -0.292515 -0.132588
155+
154: -0.349902 -0.292786 -0.135716
156+
155: -0.348739 -0.293235 -0.140529
157+
156: -0.347577 -0.293685 -0.145342
158+
157: -0.346415 -0.294135 -0.150155
159+
158: -0.345252 -0.294584 -0.154968
160+
159: -0.34409 -0.295034 -0.159781
161+
160: -0.342927 -0.295483 -0.164594
162+
161: -0.341765 -0.295933 -0.169408
163+
162: -0.340603 -0.296383 -0.174221
164+
163: -0.33944 -0.296832 -0.179034
165+
164: -0.338278 -0.297282 -0.183847
166+
165: -0.337116 -0.297732 -0.18866
167+
166: -0.335953 -0.298181 -0.193473
168+
167: -0.334791 -0.298631 -0.198286
169+
168: -0.333628 -0.29908 -0.203099
170+
169: -0.332466 -0.29953 -0.207912
171+
170: -0.331304 -0.29998 -0.212725
172+
171: -0.330141 -0.300429 -0.217538
173+
172: -0.328979 -0.300879 -0.222351
174+
173: -0.327817 -0.301329 -0.227165
175+
174: -0.326654 -0.301778 -0.231978
176+
175: -0.325492 -0.302228 -0.236791
177+
176: -0.324329 -0.302677 -0.241604
178+
177: -0.323167 -0.303127 -0.246417
179+
POLYS
180+
1: 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 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
181+
END

TetMesh/cube.vtk

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# vtk DataFile Version 2.0
2+
Unstructured Grid
3+
ASCII
4+
DATASET UNSTRUCTURED_GRID
5+
POINTS 8 double
6+
0 0 0
7+
1 0 0
8+
1 0 1
9+
0 0 1
10+
0 1 0
11+
1 1 0
12+
1 1 1
13+
0 1 1
14+
15+
CELLS 6 30
16+
4 0 4 6 5
17+
4 3 6 2 0
18+
4 0 4 7 6
19+
4 3 6 0 7
20+
4 2 0 6 1
21+
4 6 0 5 1
22+
23+
CELL_TYPES 6
24+
10
25+
10
26+
10
27+
10
28+
10
29+
10

0 commit comments

Comments
 (0)