~yade-dev/yade/0.80

« back to all changes in this revision

Viewing changes to examples/not-working/periodic-compress.py

  • Committer: Anton Gladky
  • Date: 2012-05-02 21:50:42 UTC
  • Revision ID: gladky.anton@gmail.com-20120502215042-v1fa9r65usqe7kfk
0.80.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
""" THIS SCRIPT IS NOT WORKING!
 
2
ERROR MESSAGE:
 
3
 
 
4
Running script periodic-compress.py                                                                                                  
 
5
787   WARN  yade.SpherePack /home/me/YADE/yade/pkg/dem/SpherePack.cpp:212 makeCloud: Exceeded 1000 tries to insert non-overlapping sphere to packing. Only 106 spheres was added, although you requested 700.                                                             
 
6
Vector3(20,20,10)                                                                                                                    
 
7
1567  FATAL yade.InsertionSortCollider /home/me/YADE/yade/pkg/common/InsertionSortCollider.cpp:458 spatialOverlapPeri: Body #15 spans over half of the cell size 6.93 (axis=2, min=4.26332, max=0.810043, span=10.3833, see flag allowBiggerThanPeriod)                   
 
8
1567  FATAL yade.ThreadRunner /home/me/YADE/yade/core/ThreadRunner.cpp:31 run: Exception occured:                                    
 
9
/home/me/YADE/yade/pkg/common/InsertionSortCollider.cpp: Body larger than half of the cell size encountered.                         
 
10
1581  ERROR yade.qt4   py/wrapper/yadeWrapper.cpp:372 wait: Simulation error encountered.                                            
 
11
Traceback (most recent call last):                                                                                                   
 
12
  File "/home/me/YADE/YADE3041/bin/yade-bzr3041", line 182, in runScript                                                             
 
13
    execfile(script,globals())                                                                                                       
 
14
  File "periodic-compress.py", line 28, in <module>                                                                                  
 
15
    O.wait()                                                                                                                         
 
16
RuntimeError: std::exception 
 
17
"""
 
18
 
 
19
O.periodic=True
 
20
O.cell.setBox(20,20,10)
 
21
from yade import pack,log,timing
 
22
O.materials.append(FrictMat(young=30e9,density=2400))
 
23
p=pack.SpherePack()
 
24
p.makeCloud(Vector3(0,0,0),Vector3(20,20,10),1,.5,700,True)
 
25
for sph in p:
 
26
        O.bodies.append(utils.sphere(sph[0],sph[1]))
 
27
 
 
28
 
 
29
O.timingEnabled=True
 
30
O.engines=[
 
31
        ForceResetter(),
 
32
        InsertionSortCollider([Bo1_Sphere_Aabb()]),
 
33
        InteractionLoop(
 
34
                [Ig2_Sphere_Sphere_Dem3DofGeom()],
 
35
                [Ip2_FrictMat_FrictMat_FrictPhys()],
 
36
                [Law2_Dem3DofGeom_FrictPhys_CundallStrack()],
 
37
        ),
 
38
        PeriIsoCompressor(charLen=.5,stresses=[-50e9,-1e8],doneHook="print 'FINISHED'; O.pause() ",keepProportions=True),
 
39
        NewtonIntegrator(damping=.4)
 
40
]
 
41
O.dt=utils.PWaveTimeStep()
 
42
O.saveTmp()
 
43
#print O.cell.refSize
 
44
from yade import qt; qt.Controller(); qt.View()
 
45
O.run()
 
46
O.wait()
 
47
timing.stats()
 
48
#while True:
 
49
#       O.step()
 
50
 
 
51
 
 
52
# now take that packing and pad some larger volume with it
 
53
#sp=pack.SpherePack()
 
54
#sp.fromSimulation() # take spheres from simulation; cellSize is set as well
 
55
#O.reset()
 
56
#print sp.cellSize
 
57
#sp.cellFill((30,30,30))
 
58
#print sp.cellSize
 
59
#for s in sp:
 
60
#       O.bodies.append(utils.sphere(s[0],s[1]))