-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_run.py
62 lines (53 loc) · 1.53 KB
/
test_run.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
import pydem as d
import pydem.granular as g
# sample options for a monodisperse 3D simulation in a shallow square box.
#
# (note that monodispersity combined with this deposition method tends to give
# the system enough energy to crystallise in spite of tangential friction.)
demo_3d_pack_options = {
'simulation_params' : {
'dimension' : 3,
'x_limit' : 100.0,
'y_limit' : 100.0,
'z_limit' : 30.0
},
'force_model_params' : {
'type' : d.ForceModelType.HOOKIAN,
'resitiution_coefficient' : 0.1,
'max_overlap_ratio' : 0.1,
'include_tangential_forces' : True,
'tangential_ratio' : 0.7
},
'element_generation_params' : {
'min_radius' : 1.0,
'max_radius' : 1.0,
'deposition_method' : g.DepositionMethod.RANDOM_SPACED_SHEETS,
'separation_scaling' : 1.0
}
}
# sample options for a 2D simulation in a square box.
demo_2d_pack_options = {
'simulation_params' : {
'dimension' : 2,
'x_limit' : 50.0,
'y_limit' : 50.0
},
'force_model_params' : {
'type' : d.ForceModelType.HOOKIAN,
'resitiution_coefficient' : 0.5,
'max_overlap_ratio' : 0.01,
'include_tangential_forces' : True,
'tangential_ratio' : 0.9
},
'element_generation_params' : {
'min_radius' : 0.5,
'max_radius' : 1.0,
'deposition_method' : g.DepositionMethod.RANDOM_SPACED_SHEETS,
'separation_scaling' : 0.5
}
}
print "generating 2d pack..."
system = g.generate_stable_pack(demo_2d_pack_options)
print "done! saving to disk."
d.save_system(system, 'stable_2d_pack')
print "exiting..."