File: clumpPack.py

package info (click to toggle)
yade 2026.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 34,448 kB
  • sloc: cpp: 97,645; python: 52,173; sh: 677; makefile: 162
file content (22 lines) | stat: -rw-r--r-- 838 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# -*- encoding=utf-8 -*-
# create a few clump configurations by hand
from yade import pack

c1 = pack.SpherePack([((0, 0, 0), .5), ((.5, 0, 0), .5), ((0, .5, 0), .3)])
c2 = pack.SpherePack([((0, 0, 0), .5), ((.7, 0, 0), .3), ((.9, 0, 0), .2)])
sp = pack.SpherePack()
print('Generated # of clumps:', sp.makeClumpCloud((0, 0, 0), (15, 15, 15), [c1, c2], periodic=False))
sp.toSimulation()

O.bodies.append(wall(position=0, axis=2))

O.engines = [
        #SubdomainBalancer(),
        ForceResetter(),
        InsertionSortCollider([Bo1_Sphere_Aabb(), Bo1_Wall_Aabb()]),
        InteractionLoop([Ig2_Sphere_Sphere_ScGeom(), Ig2_Wall_Sphere_ScGeom()], [Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_ScGeom_FrictPhys_CundallStrack()]),
        NewtonIntegrator(damping=.4, gravity=(0, 0, -100))
]
O.dt = .7 * PWaveTimeStep()
O.saveTmp()
O.step()