← Back to team overview

yade-users team mailing list archive

Re: [Question #256241]: Number of cohesive interactions

 

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

Jan Stránský posted a new comment:
Hi Ferenc,

sorry for late answer. Depending on exact meaning of "between clumps" (I
assume interactions only between clumps, could be also between clumps and
standalone particles), you can try:

def isInteractionBetweenClumps(interaction):
   b1,b2 = O.bodies[interaction.id1], O.bodies[interaction.id2]
   if not ( b1.isClumpMember and b2.isClumpMamber): return False # should
be interactions between clump members
   if b1.clumpId == b2.clumpId: return False # should be interactions
between members of different clumps
   return True # otherwise the interaction is between two different clumps

cohIntrsBetweenClumps = [i for i in O.interactions if
i.phys.cohesionBroken==False and isInteractionBetweenClumps(i)]
numCohIntrsBetweenClumps = len(cohIntrsBetweenClumps)

Everything could be just one Python line, but external function is created
for more readable code

I am not very familiar with CohFrictPhys, so the condition
i.phys.cohesionBroken==False for determining cohesive interactions might be
actually different..

cheers
Jan


2014-10-27 10:11 GMT+01:00 Ferenc Safranyik <
question256241@xxxxxxxxxxxxxxxxxxxxx>:

> New question #256241 on Yade:
> https://answers.launchpad.net/yade/+question/256241
>
> Hi all,
>
> I have a little problem in my simulation: I would like to determine the
> number of cohesive interactions between clumps (I work with cohFrictMat and
> CohfrictPhys and the cohesion is turned on, the sciprt is work).
>
> Thanks a lot!
>
> --
> 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
>

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.