~ubuntu-branches/ubuntu/trusty/yade/trusty

« back to all changes in this revision

Viewing changes to examples/tetra/oneTetraPoly.py

  • Committer: Package Import Robot
  • Author(s): Anton Gladky, cf3f8d9
  • Date: 2013-10-30 20:56:33 UTC
  • mfrom: (20.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20131030205633-1f01r7hjce17d723
Tags: 1.05.0-2
[cf3f8d9] Pass -ftrack-macro-expansion=0 only if gcc>=4.8. (Closes: #726009)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
################################################################################
 
2
 
3
# Script to test tetra gl functions and prescribed motion
 
4
#
 
5
################################################################################
 
6
v1 = (0,0,0)
 
7
v2 = (1,0,0)
 
8
v3 = (0,1,0)
 
9
v4 = (0,0,1)
 
10
 
 
11
t1 = tetraPoly((v1,v2,v3,v4),color=(0,1,0))
 
12
O.bodies.append((t1))
 
13
 
 
14
def changeVelocity():
 
15
        if O.iter == 50000:
 
16
                t1.state.vel = (-1,0,0)
 
17
        if O.iter == 100000:
 
18
                t1.state.vel = (0,1,-1)
 
19
        if O.iter == 150000:
 
20
                t1.state.vel = (0,0,0)
 
21
                t1.state.angMom = (0,0,10)
 
22
        if O.iter == 200000:
 
23
                O.pause()
 
24
 
 
25
O.engines = [
 
26
        ForceResetter(),
 
27
        InsertionSortCollider([Bo1_Polyhedra_Aabb()]),
 
28
        InteractionLoop([],[],[]),
 
29
        NewtonIntegrator(),
 
30
        PyRunner(iterPeriod=1,command="changeVelocity()"),
 
31
]
 
32
O.step()
 
33
 
 
34
 
 
35
try:
 
36
        from yade import qt
 
37
        qt.View()
 
38
except:
 
39
        pass
 
40
 
 
41
O.dt = 1e-5
 
42
t1.state.vel = (1,0,0)
 
43
O.run()