O.interactions[0,1] is unable to detect the interactions between sphere and wall, throwing an error stating "No such interaction"
Hi everyone,
I was doing a simulation of a sphere hitting on a wall at some distance in an acceleration field. My code is given bellow:
## code starts here
## SCRIPT TO TEST IMPACT BETWEEN A SPHERE AND A WALL (MINDLIN - nonlinear elastic model)
## list of engines
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
),
NewtonIntegrat
###
### NOTE this extra engine:
###
PyRunner(
]
## define and append material
mat=FrictMat(
O.materials.
## create a sphere and a wall and append them
s0=sphere(
w=wall(
O.bodies.append(s0)
O.bodies.append(w)
## time step
O.dt=.2*
O.saveTmp(
from yade import qt
qt.View()
qt.Controller()
#######
##### now the part pertaining to plots #####
#######
from yade import plot
def myAddPlotData():
if O.interactions[
i=O.interacti
## O.interactions[0,1] is not able to detect the interactions between sphere and wall
## error is throwing here stating "No such interaction"
## but while running the test, it is clearly visible that the sphere is colliding with wall and bouncing back
## rest of the code is working good. PLEASE HELP!!!
plot.
O.run(100,True)
## make one plot: step as function of fn
plot.plots=
## this function is called by plotDataCollector
## it should add data with the labels that we will plot
## if a datum is not specified (but exists), it will be NaN and will not be plotted
plot.plot()
## code ends here
In the above code, an error is throwing in the 46th line. The error message is given below:
IndexError Traceback (most recent call last)
/usr/bin/yade in <module>
/usr/bin/yade in myAddPlotData()
44
45 def myAddPlotData():
---> 46 if O.interactions[
47 i=O.interaction
48 ## O.interactions[0,1] is not able to detect the interactions between sphere and wall
IndexError: No such interaction
The exact same code runs good when I am trying with two spheres instead of sphere and a wall.
Please help me to figure this out. I have to track contact forces while they are impacting.
Please also tell me if there is any other way to track contact force rather using O.interactions[
Thanks in advance.
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 Sourit Saha for more information if necessary.