-
Notifications
You must be signed in to change notification settings - Fork 10
/
DPmaterial.py
109 lines (92 loc) · 5.08 KB
/
DPmaterial.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
from geotaichi import *
init()
mpm = MPM()
mpm.set_configuration(domain=ti.Vector([0.55, 0.2, 0.11]),
background_damping=0.002,
alphaPIC=0.005,
mapping="USF",
stabilize=None,
shape_function="GIMP",
gauss_number=0)
mpm.set_solver(solver={
"Timestep": 1e-5,
"SimulationTime": 0.6,
"SaveInterval": 0.01
})
mpm.memory_allocate(memory={
"max_material_number": 1,
"max_particle_number": 5.12e5,
"max_constraint_number": {
"max_velocity_constraint": 134638,
"max_friction_constraint": 134638
}
})
mpm.add_material(model="DruckerPrager",
material={
"MaterialID": 1,
"Density": 2650.,
"YoungModulus": 8.4e5,
"PossionRatio": 0.3,
"Cohesion": 0.,
"Friction": 19.8,
"Dilation": 0.,
"Tensile": 0.
})
mpm.add_element(element={
"ElementType": "R8N3D",
"ElementSize": ti.Vector([0.0025, 0.0025, 0.0025]),
"Contact": {
"ContactDetection": False
}
})
mpm.add_region(region={
"Name": "region1",
"Type": "Rectangle",
"BoundingBoxPoint": ti.Vector([0.005, 0.005, 0.005]),
"BoundingBoxSize": ti.Vector([0.2, 0.05, 0.1]),
"zdirection": ti.Vector([0., 0., 1.])
})
mpm.add_body(body={
"Template": {
"RegionName": "region1",
"nParticlesPerCell": 2,
"BodyID": 0,
"MaterialID": 1,
"ParticleStress": {
"GravityField": True,
"InternalStress": ti.Vector([-0., -0., -0., 0., 0., 0.]),
"Traction": {}
},
"InitialVelocity":ti.Vector([0, 0, 0]),
"FixVelocity": ["Free", "Free", "Free"]
}
})
mpm.add_boundary_condition(boundary=[
{
"BoundaryType": "VelocityConstraint",
"Velocity": [0., 0., -0.],
"StartPoint": [0., 0., 0.],
"EndPoint": [0.55, 0.2, 0.005]
},
{
"BoundaryType": "VelocityConstraint",
"Velocity": [0., 0., 0.],
"StartPoint": [0., 0, 0],
"EndPoint": [0.005, 0.2, 0.11]
},
{
"BoundaryType": "VelocityConstraint",
"StartPoint": [0., 0., 0.],
"EndPoint": [0.55, 0.005, 0.11],
"Velocity": [None, 0., None]
},
{
"BoundaryType": "VelocityConstraint",
"StartPoint": [0., 0.055, 0.],
"EndPoint": [0.55, 0.0575, 0.11],
"Velocity": [None, 0., None]
}
])
mpm.select_save_data()
mpm.run()
mpm.postprocessing()