← Back to team overview

yade-users team mailing list archive

Re: [Question #432617]: How to plot damage ratio curve

 

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

    Status: Answered => Open

Tina Asia is still having a problem:
Hi Luc,

Thanks for your patience, I adjusted my code and It goes well, but the
output is wrong,because the number of broken bonds does not grow
gradually with the increase of computation time (number of broken bonds:
1,23,42,32,15...). Here is a segment of my code.

O.step()
# calculate the total intact cohesive bonds
global sumCohBonds
sumCohBonds=0
for b in O.interactions: 
    if b.phys.cohesionBroken==True:
        continue
    sumCohBonds+=1
print 'first time:{}'.format(sumCohBonds)

numBroCohBonds=0
def damageRatio():
    for br in O.interactions: 
        if br.phys.cohesionBroken==False:
            continue
    numBroCohBonds+=1    # calculate broken bonds
damageRatio=numBroCohBonds/float(sumCohBonds)
print numBroCohBonds,damageRatio
print 'second time:{}'.format(sumCohBonds)

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