← Back to team overview

yade-users team mailing list archive

Re: [Question #685862]: About transverse strain

 

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

Jan Stránský proposed the following answer:
5)
Use more than one space for indentation. Here your recorder would be
###
def recorder():
    lateral()
yade.plot.addData({'i':O.iter,'eps':abs(strainer.strain),'elat':(elat),'sigma':abs(strainer.avgStress)})
###
meaning plot.addData outside recorder(), which is probably not what you want

6)
> The spheres have the same color
no, there is one sphere with different color.
In laterla(), you return directly when the very first suitable body is found.

6)+3) solution
###
def lateral():
    elatTot = 0.0 # sum of elat of all suitable particles
    nTot = 0 # number of suitable particles
    for p in O.bodies:
        x=...; z=...; d=...
        if d>r1 and d<r2:
            xnew=...; znew=...; dnew=...
            elat=(d-dnew)/d
            elatTot += elat
            nTot += 1
    return elatTot / nTot # average elat
###

cheers
Jan

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