← Back to team overview

yade-users team mailing list archive

Re: [Question #259419]: How to record the breakage of the cohesion?

 

Hi Huanran,

O.interactions contains real and also non-real interactions and its length
indeed varies during simulation. You can try something like:

intrsOrigIds = [(i.id1,i.id2) for i in O.interactions] # done at the
beginning of simulation, but after first O.step().
# import __builtins__; __builtin__.intrsOrigIds = intrsOrigIds # might be
needed (not sure) if you call the function from PyRunner

def numBroken():
   ret = 0
   for id1,id2 in intrsOrigIds:
      try:
         i = O.interactions[id1,id2]
         if i.phys.cohesionBroken:
            ret += 1
      except IndexError: # the interaction does not exist any more
         ret += 1

cheers
Jan


2014-12-28 13:26 GMT+01:00 whr <question259419@xxxxxxxxxxxxxxxxxxxxx>:

> Question #259419 on Yade changed:
> https://answers.launchpad.net/yade/+question/259419
>
>     Status: Answered => Open
>
> whr is still having a problem:
> Dear Jan,
>
> Thanks for your reply.
>
> Actually, I'm trying to count the number of the cohesion-breakage during
> compression to compare with data on acoustic emission (AE) activity.
>
> I tried the following code to count the interactions with broken
> cohesion every 100 steps.
>
>    num = 0
>    for i in O.interactions:
>       if i.phys.cohesionBroken:
>          num+=1
>
> However, when I used that code, I found the number decrease sometimes. The
> amount of interactions (len(O.interactions)) also varies.  FYI, I use
> periodic boundary.
> So, any suggestions?
>
> Cheers
> Huanran
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to     : yade-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-users
> More help   : https://help.launchpad.net/ListHelp
>

Follow ups

References