← Back to team overview

yade-users team mailing list archive

Re: TranslationEngine Vs JumpChangeSe3

 

2010/4/23 Václav Šmilauer <eudoxos@xxxxxxxx>

>
> >
> > Using ScGeom, being the bodies Dynamic and using JumpChangeSe3 should
> > work?
> > Well let's try again.. I will let you know..
>
> Make sure you set
>
> https://www.yade-dem.org/sphinx/yade.wrapper.html#yade.wrapper.JumpChangeSe3.setVelocitiesto true (it is false by default), then it will work. See c++ code as well
> for the logic. Not complicated.
>
> Hi,

both TranslationEngine and JumpChangeSe3 work if bodies are dynamic. Now I
tried a simple sphere-sphere interaction test using the basic
Law2_ScGeom_FrictPhys_Basic() law. One ball is fixed, the other one is moved
by using JumpChangeSe3 (setting setVelocities to true). The only thing I
notice is that although no damping is present, the moving ball gets the rest
at equilibrium (just run the attached script and press F8 to see what I
mean, you will see the contact normal force getting a constant value).
If I try the same test but using ForceEngine (now it is commented in the
attached file but you can try to use it while commenting out JumpChangeSe3)
I get the expected result, the moving ball is bouncing around the
equilibrium (again just run the script and press F8).

Nothing wrong, I just wuold like to understand (and maybe you can help me)
why in displacement control I do not any bouncing around the equilibrium. Is
not the same as applying a body force according to the code?

Thanks for your comment (if any) on this,

cheers, Chiara



> Cheers, v.
>
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users<https://launchpad.net/%7Eyade-users>
> Post to     : yade-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-users<https://launchpad.net/%7Eyade-users>
> More help   : https://help.launchpad.net/ListHelp
>
#!/usr/local/bin/yade-trunk -x
# -*- coding: utf-8 -*-
# -*- encoding=utf-8 -*-

# Script to test a sphere-sphere interaction in displacement control

from yade import utils

#__________________________________________________________________
# geometry
r1,r2=1e-2,1e-2 # radii [m]
p1,p2=[0,0,0],[r1+r2,0,0] # center positions [m]

#__________________________________________________________________
# material
young=600.0e6 # [N/m^2]
poisson=0.6 
density=2.60e3 # [kg/m^3]
frictionAngle=26 # [°]

# append geometry and material
O.materials.append(FrictMat(young=young,poisson=poisson,density=density,frictionAngle=frictionAngle))
O.bodies.append(utils.sphere(p1,r1,dynamic=False,wire=True)) # body id=0 
O.bodies.append(utils.sphere(p2,r2,dynamic=True,wire=True)) # body id=1

#__________________________________________________________________
# list of engines
O.engines=[
	JumpChangeSe3(subscribedBodies=[1],deltaSe3=(Vector3(-1e-10,0,0),Quaternion().IDENTITY),setVelocities=True),
	ForceResetter(),
	BoundDispatcher([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]),
	InsertionSortCollider(),
	InteractionDispatchers(
		[Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],
		[Ip2_FrictMat_FrictMat_FrictPhys()],
		[Law2_ScGeom_FrictPhys_Basic()]
	),
	#ForceEngine(force=(-20,0,0),subscribedBodies=[1]),
	NewtonIntegrator(damping=0.0),
	PeriodicPythonRunner(iterPeriod=1,command='myAddPlotData()')
]

#__________________________________________________________________
# time step
O.dt=1.e-5
O.saveTmp('init')

#__________________________________________________________________
from yade import qt
qt.View()
qt.Controller()

#__________________________________________________________________
# plot some results
from math import *
from yade import plot

plot.plots={'overlapping':('Fn',),'time':('Fn',)}

def myAddPlotData():
	i=O.interactions[0,1]
	plot.addData(Fn=i.phys.normalForce[0],
		un=(r1+r2)-(O.bodies[1].state.pos[0]-O.bodies[0].state.pos[0]),
		overlapping=i.geom.penetrationDepth,
		time=O.time,
		time_=O.time,
		time__=O.time,
		vel=O.bodies[1].state.vel[0],
		accel=O.bodies[1].state.accel[0]
		)

# We will have:
# 1) data in graphs (if you call plot.plot())
# 2) data in file (if you call plot.saveGnuplot('/home/chia/Desktop/Output/out')
# 3) data in memory as plot.data['un'], plot.data['fn'], etc. under the labels they were saved

O.run(150,True)





Follow ups

References