KeyError
Hi All,
I'm trying to do a gravity deposit and record the contact information. For example, normal contact force for every particle.
I write the code like this:
#######
import numpy as np
from yade import pack, plot, export, utils
import math
O.bodies.
sp=pack.
sp.makeCloud(
sp.toSimulation()
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
),
PyRunner(
PyRunner(
NewtonIntegrat
]
O.dt=.5*
print(len(
def checkUnbalanced():
if unbalancedForce
O.pause()
d = 0
def contact_info():
global d
fn_normals_cal_1 = []
for i in O.interactions:
if not i.isReal:continue
if isinstance(
fn_normal_cal_1 = i.phys.
fn_normals_
plot.reset()
h = 0
n = len(fn_
while h < n:
h = h+1
plot.saveDataT
d = d+1
O.run(10000,True)
#######
the error is:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "rotation_awn.py", line 40, in contact_info
plot.
File "/packages/
for i in range(len(
KeyError: 'e'
###############
when I changed these lines:
while h < n:
h = h+1
plot.saveDataT
d = d+1
###### the code works very well.
Is there any special format for vars or something wrong with the code?
best,
yong
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 ytang for more information if necessary.