How to calculate bond (interaction) breakage ratio

Asked by Leonard on 2020-07-16

Hi,

I am working on a drained triaxial compression test and I'd like to know how to gain the bond (i.e., interaction) breakage ratio (defined as number of broken initial interactions over number of initial interactions).

For getting number of initial interactions, I did it as:

iniIntrs=[]
for i in O.interactions:
 if i.isReal:
  iniIntrs.append((i.id1,i.id2))
so len(iniIntrs) is the number of initial interactions.
However, I didn't come up with an effective way to get the number of broken initial interactions at current step, do you have any ideas?

Thanks
Leonard

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Leonard
Solved:
2020-07-16
Last query:
2020-07-16
Last reply:
2020-07-16
Jan Stránský (honzik) said : #1

Hello,

> for i in O.interactions:
> if i.isReal:

"if i.isReal" is not needed, as "i" is guaranteed to be real, because "iteration silently skips interactions that are not real" [1]

an approach could be using Python sets [2] (efficient, elegant, ...):
###
iniIntrs = set((i.id1,i.id2) for i in O.interactions)
... # some running
curIntrs = set((i.id1,i.id2) for i in O.interactions)
brokenIntrs = iniIntrs - curIntrs
###

cheers
Jan

[1] https://yade-dem.org/doc/yade.wrapper.html#interactioncontainer
[2] https://docs.python.org/3/library/stdtypes.html#set-types-set-frozenset

Leonard (z2521899293) said : #2

Hi Jan,

Thanks for your reply. Using Python set is a great idea.

I still have one doubt, since there is no oder (or random order) for id1 and id2 in one O.interaction[1], so using iniIntrs = set((i.id1,i.id2) for i in O.interactions could get (id1,id2) or (id2,id1), does curIntrs = set((i.id1,i.id2) for i in O.interactions get the same one?

For example, my doubt is:
If I get iniIntrs = ((1,2),(3,4)), and get curIntrs=((1,2),(5,6)), then brokenIntrs = iniIntrs - curIntrs=(3,4), which is perfect!
Is there any possible that I get iniIntrs = ((1,2),(3,4)), and get curIntrs=((2,1),(5,6)), then brokenIntrs = iniIntrs - curIntrs=((1,2),(3,4)), which is not good since O.interaction[1,2] is not broken.

Thanks
Leonard
[1]https://answers.launchpad.net/yade/+question/402893

Jan Stránský (honzik) said : #3

good point on the ids order.
you can change
set((i.id1,i.id2) for i in O.interactions)
to
set(tuple(sorted((i.id1,i.id2))) for i in O.interactions)
to have the stored ids sorted.

The order of id1,id2 is not changed for existing interaction.
So if your original interaction is (1,2), than if you get (2,1) would mean that it is another interaction (and the original one is broken).

Which implies another note: what if the original interaction is broken and then the two particles come to contact again after some time? You would get again e.g. (1,2), it would be actually broken interaction but using this approach you would count it as initial..

What material model you use? How are broken / non-cohesive interactions different from initial interactions?

cheers
Jan

Leonard (z2521899293) said : #4

Hi Jan,

>The order of id1,id2 is not changed for existing interaction.
That is great, so using the first approach (in #1) is perfect, my doubt is solved.

>the two particles come to contact again after some time?
You are right, the breakage ratio I want to investigate is for initial interactions, so again the first approach is exactly suitable.

>What material model you use?
I use CohFrictMat as material of sphere particles:
CohFrictMat(isCohesive=False,young,alphaKr,alphaKtw, poisson,frictionAngle,etaRoll,etaTwist, density,normalCohesion,shearCohesion, momentRotationLaw=True)

>How are broken / non-cohesive interactions different from initial interactions?
I'd like to look at how many initial interactions have broken with the strain. I am sorry I didn't understand the difference. Did I miss something?

Thanks
Leonard

Jan Stránský (honzik) said : #5

>> the two particles come to contact again after some time?
> You are right, the breakage ratio I want to investigate is for initial interactions, so again the first approach is exactly suitable.

what I meant that initially there is interaction (1,2), after some time the particles are split, interaction (1,2) does not exist, but after another some time the particles come to contact again and interaction (1,2) is recreated. According to history, (1,2) is clearly "broken", but it is treated as the initial (1,2) with this approach.

> I am sorry I didn't understand the difference.

I meant something like that initial interactions has i.phys.isCohesive=True and the broken i.phys.isCohesive=False. Do you have something like that, or you are merely dependent on the existence of the interaction?

cheers
Jan

Leonard (z2521899293) said : #6

Hi Jan,
Thanks for your reply.

>the two particles come to contact again after some time.
Thanks, I got it.

 >Do you have something like that, or you are merely dependent on the existence of the interaction?
At this stage, I set isCohesive=False in the material (which is for pure sand), so I am merely dependent on the existence of the interaction.

Cheers
Leonard