← Back to team overview

yade-users team mailing list archive

Re: [Question #404328]: contact position at the end of the simulation

 

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

Jan Stránský proposed the following answer:
Hi Jabrane,

I could not reproduce your problem. I have tried the script and it saves
the data ok containing ~65000 x y z entries (exactly the same number as
there is in the simulation)

a few comments:

1) do not mix spaces and tabs as indents in one file, it is then very
confusing (even if it works ok)

2) don't use plot.data for exporting this kind of data. Especially if you
already have some completely other data added (from recorder() function),
it becomes a mess.. Just use a simple function to write to a file:
#####################################
with open(someFileName,'w') as f: # f is closed automatically after with
block
  for i in O.interactions: # only iterates over real interactions, no need
to check it
    if isinstance(...) and isinstance(...):
      cp = i.geom.contactPoint
      f.write('{} {} {}\n'.format(cp[0],cp[1],cp[2]))
#####################################

cheers
Jan

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