← Back to team overview

yade-users team mailing list archive

[Question #690160]: i.geom.incidentVel is not a vector

 

New question #690160 on Yade:
https://answers.launchpad.net/yade/+question/690160

Hello,

This is a very basic question
I want to use i.geom.incidentVel as the incident velocity of an interaction (https://yade-dem.org/doc/yade.wrapper.html?highlight=geom%20incidentvel#yade.wrapper.ScGeom.incidentVel).
But, unfortunately, when i print it in my script, the output is not a vector but is: 
<bound method ScGeom.incidentVel of <ScGeom instance at 0x7ff930003690>>

Can you explain me what's happening ??

My very simple script is below

Best

V.

#*********************************************************************************
# basic simulation showing sphere falling ball gravity,
# bouncing against another sphere

# DATA COMPONENTS

# add 2 particles to the simulation
# they the default material (utils.defaultMat)
O.bodies.append([
	sphere(center=(0,0,0),radius=.5),
	sphere((0,0,0.9),.5)
])

# FUNCTIONAL COMPONENTS

# simulation loop -- see presentation for the explanation
O.engines=[
	ForceResetter(),
	InsertionSortCollider([Bo1_Sphere_Aabb()]),
	InteractionLoop(
		[Ig2_Sphere_Sphere_ScGeom()],        # collision geometry
		[Ip2_FrictMat_FrictMat_FrictPhys()], # collision "physics"
		[Law2_ScGeom_FrictPhys_CundallStrack()]
		),   # contact law -- apply forces
		PyRunner(iterPeriod=1,command="contactp()"),
	# Apply gravity force to particles. damf ing: numerical dissipation of energy.
		NewtonIntegrator(gravity=(0,0,-9.81),damping=0.1)
]

# set timestep to a fraction of the critical timestep
O.dt=.5e-4*PWaveTimeStep()

# save the simulation, so that it can be reloaded later, for experimentation
O.saveTmp()



def contactp():

	for i in O.interactions:

		particle1= O.bodies[i.id1]
		particle2= O.bodies[i.id2]

		cp = i.geom.contactPoint 
		R1=i.geom.refR1; R2=i.geom.refR2
		pdepth=i.geom.penetrationDepth

		v = i.geom.incidentVel

		print 'id1=', i.id1,'id2=', i.id2
		print 'R1=',R1,'R2=',R2
		print 'cp=', i.geom.contactPoint
		print 'pdepth=', i.geom.penetrationDepth
		print 'incidentVel=', v
#**************************************************************************************


-- 
You received this question notification because your team yade-users is
an answer contact for Yade.