~yade-dev/yade/0.80

« back to all changes in this revision

Viewing changes to examples/test/exact-rot.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
# -*- encoding=utf-8 -*-
 
2
from math import *
 
3
O.engines=[
 
4
        ForceResetter(),
 
5
        InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]),
 
6
        IGeomDispatcher([
 
7
                Ig2_Sphere_Sphere_ScGeom(),
 
8
                Ig2_Facet_Sphere_ScGeom(),
 
9
        ]),
 
10
        IPhysDispatcher([Ip2_FrictMat_FrictMat_FrictPhys()]),
 
11
        ElasticContactLaw(),
 
12
        RotationEngine(ids=[1],rotationAxis=(1,0,0),angularVelocity=.01),
 
13
        RotationEngine(ids=[0],rotationAxis=(1,1,1),angularVelocity=-.02),
 
14
        NewtonIntegrator(damping=.2,gravity=(0,0,-9.81))
 
15
]
 
16
from yade import utils
 
17
O.bodies.append(utils.sphere([0,0,0],1,fixed=True,color=[1,0,0],wire=True))
 
18
O.bodies.append(utils.sphere([0,sqrt(2),sqrt(2)],1,color=[0,1,0],wire=True))
 
19
 
 
20
O.dt=.01*utils.PWaveTimeStep()
 
21
O.saveTmp()
 
22
#o.run(100000); o.wait(); print o.iter/o.realtime,'iterations/sec'
 
23
from yade import qt
 
24
qt.View()
 
25
renderer=qt.Renderer()
 
26
renderer.intrGeom=True
 
27
qt.Controller()
 
28
O.step(); O.step(); O.step()
 
29
O.run(20000)