Problem with the combined engine
Hi,
I'm new with Yade, and I have problem with combined engine. I want to change the translationAxis and the velocity after a few iterations but I still have an issue about the global variables.
Could you help me?
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
from builtins import range
import random
from yade import ymport
from yade import pack, qt
## PhysicalParameters
## Import geometry
rod = O.bodies.
# Plate dimension
thickness = 1.0 # cm
width = 5.0 # cm
length = 11.0 # cm
boxMax = (2,2.5,0)
# Spheres
sphereRadius = 0.05 # cm
ndiv_x = length/
ndiv_y = width/(
ndiv_z = thickness/
#nbSpheres = (ndiv_x,
nbSpheres = (40,40,
print("Creating %d spheres.
for i in range(nbSpheres
for j in range(nbSpheres
for k in range(nbSpheres
x = boxMax[
y = boxMax[
z = boxMax[
r = random.
fixed = False
color=
if (i==0 or i==nbSpheres[0]-1 or k==nbSpheres[2]-1 or j==0 or j==nbSpheres[1]-1):
fixed = True
color=
O.bodies.
print("done\n")
## Estimate time step
#O.dt=PWaveTime
O.dt=0.0001
def updateParameters():
aTime = (O.iter*O.dt)
if aTime>0.005: # fist part
velVec = Vector3(-1,0,0)
tranVel = 1.0
transEngine.
transEngine.
## Engines
O.engines=[
ForceResetter(), # 0
InsertionSortC
Bo1_Sphere_
Bo1_Facet_Aabb(),
]),
InteractionLoop( # 2
[Ig2_
[Ip2_
[Law2_
),
CombinedKinema
NewtonIntegrat
PyRunner(
# save data from Yade's own 3d view
#qt.SnapshotEn
#PyRunner(
]
import sys,time
print("Start simulation: ")
nbIter=60
from yade import qt
v=qt.View()
v.eyePosition=
O.stopAtIter=nbIter
O.run()
# this function is called when the simulation is finished
def finish():
# snapshot is label of qt.SnapshotEngine
# the 'snapshots' attribute contains list of all saved files
makeVideo(
O.pause()
#for t in xrange(2):
# start=time.
# speed=nbIter/
#print "FINISH"
#quit()
BR
Przemek
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Przemek for more information if necessary.