← Back to team overview

yade-users team mailing list archive

Re: [Question #691285]: Extract Normals and Shears/tangentials forces on a ballMill

 

Question #691285 on Yade changed:
https://answers.launchpad.net/yade/+question/691285

NGANDU KALALA Gauthier posted a new comment:
Hi Jan,

Sorry, I replace data.push(d) y data.append(d), however, the data file
thoes'nt appear any where.

But i'm trying to use this code to save just fn separately
def exportForces():
fn = 0    # initialization of the normal force
  for i in O.interactions:
    # detection of Force by sphere on facet
    if isinstance(O.bodies[i.id1].shape,Sphere) \
        and isinstance(O.bodies[i.id2].shape,Facet):
      fn = fn + i.phys.normalForce
  out=open(os.getcwd()+'/output/normalForce','a')
  out.write('%g\n'%(fn))
  out.close()
O.engines=[
.......
PyRunner(command='exportForces()',iterPeriod=int(math.ceil(tRec/O.dt)))

......]
The normalForce file appear in the folder of simulation, but the value of  fn  extracted at any time step is always 0.

What do you think?

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