Changeset 959


Ignore:
Timestamp:
Jun 19, 2013 1:00:42 PM (8 years ago)
Author:
vondreele
Message:

added cell2GS & Uij2Ueqv

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIlattice.py

    r949 r959  
    270270    pass
    271271   
     272def cell2GS(cell):
     273    ''' returns Uij to betaij conversion matrix'''
     274    G,g = cell2Gmat(cell)
     275    GS = G
     276    GS[0][1] = GS[1][0] = math.sqrt(GS[0][0]*GS[1][1])
     277    GS[0][2] = GS[2][0] = math.sqrt(GS[0][0]*GS[2][2])
     278    GS[1][2] = GS[2][1] = math.sqrt(GS[1][1]*GS[2][2])
     279    return GS   
     280   
     281def Uij2Ueqv(Uij,GS,Amat):
     282    ''' returns 1/3 trace of diagonalized U matrix'''
     283    U = np.multiply(U6toUij(Uij),GS)
     284    U = np.inner(Amat,np.inner(U,Amat).T)
     285    E,R = nl.eigh(U)
     286    return (E[0]+E[2]+E[5])/3.      #lower triangle?
     287       
    272288def CosSinAngle(U,V,G):
    273289    """ calculate sin & cos of angle between U & V in generalized coordinates
Note: See TracChangeset for help on using the changeset viewer.