Changeset 915


Ignore:
Timestamp:
May 16, 2013 4:31:21 PM (9 years ago)
Author:
vondreele
Message:

RB now seem OK, SC now seem OK for F & F2 refinements.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r910 r915  
    296296    if 'S' in TLStype:
    297297        S = np.array(TLS[12:])*(np.pi/180.)
    298     g = np.inner(Bmat,Bmat)
    299     gvec = 1./np.sqrt(np.array([g[0][0]**2,g[1][1]**2,g[2][2]**2,
     298    g = nl.inv(np.inner(Bmat,Bmat))
     299    gvec = np.sqrt(np.array([g[0][0]**2,g[1][1]**2,g[2][2]**2,
    300300        g[0][0]*g[1][1],g[0][0]*g[2][2],g[1][1]*g[2][2]]))
    301301    Uout = []
     
    14151415        q=r+ai+bj+ck
    14161416    '''
    1417     aa = Q[0]**2
    1418     ab = Q[0]*Q[1]
    1419     ac = Q[0]*Q[2]
    1420     ad = Q[0]*Q[3]
    1421     bb = Q[1]**2
    1422     bc = Q[1]*Q[2]
    1423     bd = Q[1]*Q[3]
    1424     cc = Q[2]**2
    1425     cd = Q[2]*Q[3]
    1426     dd = Q[3]**2
     1417    QN = normQ(Q)
     1418    aa = QN[0]**2
     1419    ab = QN[0]*QN[1]
     1420    ac = QN[0]*QN[2]
     1421    ad = QN[0]*QN[3]
     1422    bb = QN[1]**2
     1423    bc = QN[1]*QN[2]
     1424    bd = QN[1]*QN[3]
     1425    cc = QN[2]**2
     1426    cd = QN[2]*QN[3]
     1427    dd = QN[3]**2
    14271428    M = [[aa+bb-cc-dd, 2.*(bc-ad),  2.*(ac+bd)],
    14281429        [2*(ad+bc),   aa-bb+cc-dd,  2.*(cd-ab)],
  • trunk/GSASIIstruct.py

    r910 r915  
    745745    rpd = np.pi/180.
    746746    rpd2 = rpd**2
    747     g = np.inner(Bmat,Bmat)
     747    g = nl.inv(np.inner(Bmat,Bmat))
    748748    gvec = np.sqrt(np.array([g[0][0]**2,g[1][1]**2,g[2][2]**2,
    749749        g[0][0]*g[1][1],g[0][0]*g[2][2],g[1][1]*g[2][2]]))
     
    783783                    dFdvDict[pfx+'RBV'+OIds[iv]+rbsx] += dXdO[ix]*dFdvDict[pfx+atxIds[ix]+str(atNum)]
    784784            X = G2mth.prodQVQ(Q,Cart[ia])
    785             dFdu = np.array([dFdvDict[pfx+Uid+str(AtLookup[atId])] for Uid in atuIds]).T*gvec
     785            dFdu = np.array([dFdvDict[pfx+Uid+str(AtLookup[atId])] for Uid in atuIds]).T/gvec
    786786            dFdu = G2lat.U6toUij(dFdu.T)
    787787            dFdu = np.tensordot(Amat,np.tensordot(Amat,dFdu,([1,0])),([0,1]))
     
    851851                    dFdvDict[pfx+'RBR'+OIds[iv]+rbsx] += dXdO[ix]*dFdvDict[pfx+atxIds[ix]+str(atNum)]
    852852            X = G2mth.prodQVQ(Q,Cart[ia])
    853             dFdu = np.array([dFdvDict[pfx+Uid+str(AtLookup[atId])] for Uid in atuIds]).T*gvec
     853            dFdu = np.array([dFdvDict[pfx+Uid+str(AtLookup[atId])] for Uid in atuIds]).T/gvec
    854854            dFdu = G2lat.U6toUij(dFdu.T)
    855855            dFdu = np.tensordot(Amat.T,np.tensordot(Amat,dFdu,([1,0])),([0,1]))
Note: See TracChangeset for help on using the changeset viewer.