Ignore:
Timestamp:
Mar 15, 2021 2:51:46 PM (9 months ago)
Author:
vondreele
Message:

fix to development of Uij constraints for atoms on 3 folds; lines 1571-1582 in G2strIO.
remove 2.* from dFdvDict terms for AU12, 13 & 23 in various structure factor derivative routines in G2strMath

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIstrMath.py

    r4852 r4853  
    749749    ast = np.sqrt(np.diag(G))
    750750    Mast = twopisq*np.multiply.outer(ast,ast)
    751     SGMT = np.array([ops[0].T for ops in SGData['SGOps']])      #### ops[0].T
     751    SGMT = np.array([ops[0].T for ops in SGData['SGOps']])      # must be ops[0].T
    752752    SGT = np.array([ops[1] for ops in SGData['SGOps']])
    753753    FFtables = calcControls['FFtables']
     
    822822        Tiso = np.repeat(np.where(biso<1.,np.exp(biso),1.0),len(SGT)*len(TwinLaw),axis=1).T
    823823        HbH = -np.sum(Uniq.T*np.swapaxes(np.inner(bij,Uniq),2,-1),axis=1)
     824#        HbH = -np.sum(np.inner(Uniq,bij)*Uniq[:,:,nxs,:],axis=-1).T    #doesn't work, but should!
    824825        Tuij = np.where(HbH<1.,np.exp(HbH),1.0).T
    825826        Tcorr = np.reshape(Tiso,Tuij.shape)*Tuij*Mdata*Fdata/len(SGMT)
     
    875876    ast = np.sqrt(np.diag(G))
    876877    Mast = twopisq*np.multiply.outer(ast,ast)
    877     SGMT = np.array([ops[0].T for ops in SGData['SGOps']])    #### ops[0].T?
     878    SGMT = np.array([ops[0].T for ops in SGData['SGOps']])    # must be ops[0].T
    878879    SGT = np.array([ops[1] for ops in SGData['SGOps']])
    879880    FFtables = calcControls['FFtables']
     
    933934        biso = -SQfactor*Uisodata[:,nxs]
    934935        Tiso = np.repeat(np.where(biso<1.,np.exp(biso),1.0),len(SGT),axis=1).T
    935         HbH = -np.sum(Uniq.T*np.swapaxes(np.inner(bij,Uniq),2,-1),axis=1)
    936         Tuij = np.where(HbH<1.,np.exp(HbH),1.0).T
     936        HbH = -np.sum(Uniq.T*np.swapaxes(np.inner(bij,Uniq),2,-1),axis=1)       #Natm,Nops,Nref
     937#        HbH = -np.sum(np.inner(Uniq,bij)*Uniq[:,:,nxs,:],axis=-1).T    #doesn't work, but should!
     938        Tuij = np.where(HbH<1.,np.exp(HbH),1.0).T       #Nref,Nops,Natm
    937939        Tcorr = np.reshape(Tiso,Tuij.shape)*Tuij*Mdata*Fdata/len(SGMT)
    938940        Hij = np.array([Mast*np.multiply.outer(U,U) for U in np.reshape(Uniq,(-1,3))])      #Nref*Nops,3,3
     
    10041006        dFdvDict[pfx+'AU22:'+str(i)] = dFdua.T[1][i]
    10051007        dFdvDict[pfx+'AU33:'+str(i)] = dFdua.T[2][i]
    1006         dFdvDict[pfx+'AU12:'+str(i)] = 2.*dFdua.T[3][i]
    1007         dFdvDict[pfx+'AU13:'+str(i)] = 2.*dFdua.T[4][i]
    1008         dFdvDict[pfx+'AU23:'+str(i)] = 2.*dFdua.T[5][i]
     1008        dFdvDict[pfx+'AU12:'+str(i)] = dFdua.T[3][i]
     1009        dFdvDict[pfx+'AU13:'+str(i)] = dFdua.T[4][i]
     1010        dFdvDict[pfx+'AU23:'+str(i)] = dFdua.T[5][i]
    10091011    dFdvDict[phfx+'Flack'] = 4.*dFdfl.T
    10101012    dFdvDict[phfx+'BabA'] = dFdbab.T[0]
     
    13101312        dFdvDict[pfx+'AU22:'+str(i)] = dFdua.T[1][i]
    13111313        dFdvDict[pfx+'AU33:'+str(i)] = dFdua.T[2][i]
    1312         dFdvDict[pfx+'AU12:'+str(i)] = 2.*dFdua.T[3][i]
    1313         dFdvDict[pfx+'AU13:'+str(i)] = 2.*dFdua.T[4][i]
    1314         dFdvDict[pfx+'AU23:'+str(i)] = 2.*dFdua.T[5][i]
     1314        dFdvDict[pfx+'AU12:'+str(i)] = dFdua.T[3][i]
     1315        dFdvDict[pfx+'AU13:'+str(i)] = dFdua.T[4][i]
     1316        dFdvDict[pfx+'AU23:'+str(i)] = dFdua.T[5][i]
    13151317    return dFdvDict
    13161318       
     
    14681470        dFdvDict[pfx+'AU22:'+str(i)] = np.sum(dFdua.T[1][i]*TwinFr[:,nxs],axis=0)
    14691471        dFdvDict[pfx+'AU33:'+str(i)] = np.sum(dFdua.T[2][i]*TwinFr[:,nxs],axis=0)
    1470         dFdvDict[pfx+'AU12:'+str(i)] = 2.*np.sum(dFdua.T[3][i]*TwinFr[:,nxs],axis=0)
    1471         dFdvDict[pfx+'AU13:'+str(i)] = 2.*np.sum(dFdua.T[4][i]*TwinFr[:,nxs],axis=0)
    1472         dFdvDict[pfx+'AU23:'+str(i)] = 2.*np.sum(dFdua.T[5][i]*TwinFr[:,nxs],axis=0)
     1472        dFdvDict[pfx+'AU12:'+str(i)] = np.sum(dFdua.T[3][i]*TwinFr[:,nxs],axis=0)
     1473        dFdvDict[pfx+'AU13:'+str(i)] = np.sum(dFdua.T[4][i]*TwinFr[:,nxs],axis=0)
     1474        dFdvDict[pfx+'AU23:'+str(i)] = np.sum(dFdua.T[5][i]*TwinFr[:,nxs],axis=0)
    14731475    dFdvDict[phfx+'BabA'] = dFdbab.T[0]
    14741476    dFdvDict[phfx+'BabU'] = dFdbab.T[1]
     
    19881990        dFdvDict[pfx+'AU22:'+str(i)] = dFdua.T[1][i]
    19891991        dFdvDict[pfx+'AU33:'+str(i)] = dFdua.T[2][i]
    1990         dFdvDict[pfx+'AU12:'+str(i)] = 2.*dFdua.T[3][i]
    1991         dFdvDict[pfx+'AU13:'+str(i)] = 2.*dFdua.T[4][i]
    1992         dFdvDict[pfx+'AU23:'+str(i)] = 2.*dFdua.T[5][i]
     1992        dFdvDict[pfx+'AU12:'+str(i)] = dFdua.T[3][i]
     1993        dFdvDict[pfx+'AU13:'+str(i)] = dFdua.T[4][i]
     1994        dFdvDict[pfx+'AU23:'+str(i)] = dFdua.T[5][i]
    19931995        for j in range(FSSdata.shape[1]):        #loop over waves Fzero & Fwid?
    19941996            dFdvDict[pfx+'Fsin:'+str(i)+':'+str(j)] = dFdGf.T[0][j][i]
     
    20142016            dFdvDict[pfx+'U22cos:'+str(i)+':'+str(j)] = dFdGu.T[7][j][i]
    20152017            dFdvDict[pfx+'U33cos:'+str(i)+':'+str(j)] = dFdGu.T[8][j][i]
    2016             dFdvDict[pfx+'U12cos:'+str(i)+':'+str(j)] = 2.*dFdGu.T[9][j][i]
    2017             dFdvDict[pfx+'U13cos:'+str(i)+':'+str(j)] = 2.*dFdGu.T[10][j][i]
    2018             dFdvDict[pfx+'U23cos:'+str(i)+':'+str(j)] = 2.*dFdGu.T[11][j][i]
     2018            dFdvDict[pfx+'U12cos:'+str(i)+':'+str(j)] = dFdGu.T[9][j][i]
     2019            dFdvDict[pfx+'U13cos:'+str(i)+':'+str(j)] = dFdGu.T[10][j][i]
     2020            dFdvDict[pfx+'U23cos:'+str(i)+':'+str(j)] = dFdGu.T[11][j][i]
    20192021           
    20202022    dFdvDict[phfx+'Flack'] = 4.*dFdfl.T
     
    22222224        dFdvDict[pfx+'AU22:'+str(i)] = dFdua.T[1][i]
    22232225        dFdvDict[pfx+'AU33:'+str(i)] = dFdua.T[2][i]
    2224         dFdvDict[pfx+'AU12:'+str(i)] = 2.*dFdua.T[3][i]
    2225         dFdvDict[pfx+'AU13:'+str(i)] = 2.*dFdua.T[4][i]
    2226         dFdvDict[pfx+'AU23:'+str(i)] = 2.*dFdua.T[5][i]
     2226        dFdvDict[pfx+'AU12:'+str(i)] = dFdua.T[3][i]
     2227        dFdvDict[pfx+'AU13:'+str(i)] = dFdua.T[4][i]
     2228        dFdvDict[pfx+'AU23:'+str(i)] = dFdua.T[5][i]
    22272229        for j in range(FSSdata.shape[1]):        #loop over waves Fzero & Fwid?
    22282230            dFdvDict[pfx+'Fsin:'+str(i)+':'+str(j)] = dFdGf.T[0][j][i]
Note: See TracChangeset for help on using the changeset viewer.