Exemple #1
0
def r(ngrain=500, odf=None, header='tmp', fsx=None, interaction=None):
    """
    R-values
    """
    import os
    ss(odf=odf, iang=10, ngrain=ngrain, header=header)
    
    ftex = '%s_%s.cmb'%(header,str(ngrain).zfill(5))
    a = vpsc_examples.prob(dang=45, texture=ftex, fsx=fsx,
                           interaction=interaction,
                           ifig=3)
    a.__run__()
    a.ang; a.r; a.ys 
    os.remove(ftex)   
    return a.r, a.ys
def uni(ifig=1, ftex=None, fsx=None, dang=None, jobid=20):
    """
    in-plane variation of uniaxial yield stress mapped into
    xx-yy-xy stress space
    """
    from vpsc_examples import prob
    R = np.zeros((3,3)) #rotation matrix
    
    myprob = prob(
        dang=dang, texture=ftex,
        fsx=fsx, jobid=jobid)
    
    ang, ys, r , nys = myprob.__run__()

    xx=[];yy=[];xy=[]
    for i in range(len(ang)):
        # rotation matrix construction
        rang = ang[i]*np.pi/180.
        R[0,0] = cos(rang)
        R[0,1] = sin(rang)
        R[1,0] = -R[0,1]
        R[1,1] = R[0,0]
        R[2,2] = 1.
        ## --
        ## - uniaxial tension stress-state
        sig = np.zeros((3,3))
        sig[0,0] = ys[i]
        ## --
        ## rotation of the stress tensor
        #sig = np.dot(np.dot(R,sig),R.transpose())
        sig = np.dot(np.dot(R.transpose(),sig),R)
        xx.append(sig[0,0])
        yy.append(sig[1,1])
        xy.append(sig[0,1])
        pass
    return xx,yy,xy