Calculate the number of broken bonds in Cpm mat

Asked by Akm

Hi,

I am trying to calculate the number of bonds broken at each iteration in my simulation. I am using the cpm material and tried to plot it using the concept where I check if 'iscohesive==True ' but it doesn't work. Is there any other way to get these numbers?

Many thanks,
Arun

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Stránský
Solved:
Last query:
Last reply:
Revision history for this message
Robert Caulk (rcaulk) said :
#1

>but it doesn't work

Why doesn't it work?

Revision history for this message
Jan Stránský (honzik) said :
#2

> ... tried to plot it using the concept where I check if 'iscohesive==True '

please be more specific (ideally post a MWE [1])

> Is there any other way to get these numbers?

no, because "the concept where I check if 'iscohesive==True'" is the correct one

cheers
Jan

[1] https://www.yade-dem.org/wiki/Howtoask

Revision history for this message
Akm (arunkumarmurali) said :
#3

Hi Jan and Robert,

My script is pretty lengthy and has a lot of imports. So let me just stick to those commands where I calculate the bond breakage statistics.

I do not get any change in the cohesive bond numbers even when I can see particles flying after bond breakage.

###At the start of the program
global cohesive_count
cohesive_count=0
for i in O.interactions:
    if hasattr(i.phys, 'isCohesive'):
        if i.phys.isCohesive == True:
            cohesive_count+=1

###Inside a Pyrunner:
    presentcohesive_count = 0
    for i in O.interactions:
        if hasattr(i.phys, 'isCohesive'):
            if i.phys.isCohesive == 1:
                presentcohesive_count+=1
    noncohesive_count= cohesive_count-presentcohesive_count
    print (noncohesive_count)

Revision history for this message
Best Jan Stránský (honzik) said :
#5

Have a look at Law2.omegaThreshold [1]. Set it to a value < 1 to actually break any interactions (currently the interactions are not broken even if they transmit almost no forces)
cheers
Jan

[1] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Law2_ScGeom_CpmPhys_Cpm.omegaThreshold

Revision history for this message
Akm (arunkumarmurali) said :
#6

Thanks Jan Stránský, that solved my question.