Changeset 2534


Ignore:
Timestamp:
Nov 18, 2016 1:41:13 PM (5 years ago)
Author:
vondreele
Message:

fix exp importer for magnetic structures - mishandled U's

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIstrMath.py

    r2523 r2534  
    10121012    Gdata = SGData['MagMom'][nxs,:,nxs]*Gdata   #flip vectors according to spin flip
    10131013    Gdata = np.inner(Amat,Gdata.T)              #convert back to cart. space MXYZ, Natoms, NOps
    1014     dGdM = SGData['MagMom'][nxs,:,nxs]*dGdM
     1014#    dGdM = SGData['MagMom'][nxs,:,nxs]*dGdM
    10151015    Gdata = np.swapaxes(Gdata,1,2)              # put Natoms last - Mxyz,Nops,Natms
    10161016#    GSASIIpath.IPyBreak()
     
    10701070        Q = HM[:,:,nxs,nxs]*eDotK[nxs,:,:,:]-Gdata[:,nxs,:,:] #Mxyz,Nref,Nop,Natm = BPM in magstrfc.for OK
    10711071        dqdm = np.array([np.outer(hm,hm)-np.eye(3) for hm in HM.T]).T   #Mxyz,Mxyz,Nref (3x3 matrix)
    1072         dqmx = np.sum(dqdm[:,:,:,nxs,nxs]*dGdm[:,nxs,nxs,:1,:],axis=0)   #matrix * vector = vector
    1073         dmx = Q*dGdM[:,nxs,:1,:]+dqmx                                    #*Mag canceled out of dqmx term
     1072        dqmx = np.sum(dqdm[:,:,:,nxs,nxs]*dGdm[:,nxs,nxs,:,:]*SGData['SpnFlp'][nxs,nxs,nxs,:,nxs],axis=0)   #matrix * vector = vector
     1073        dmx = Q*dGdM[:,nxs,:,:]+dqmx                                    #*Mag canceled out of dqmx term
    10741074#        GSASIIpath.IPyBreak()
    10751075#
     
    10931093        dfbdua = np.sum(-Hij[nxs,:,:,nxs,:]*fbm[:,:,:,:,nxs],axis=2)
    10941094        #accumulate derivatives   
    1095         dFdfr[iBeg:iFin] = 2.*np.sum((fams[:,:,nxs]*dfadfr+fbms[:,:,nxs]*dfbdfr)*Mdata/Nops,axis=0)
    1096         dFdx[iBeg:iFin] =  2.*np.sum(fams[:,:,nxs,nxs]*dfadx+fbms[:,:,nxs,nxs]*dfbdx,axis=0)
    1097         dFdMx[:,iBeg:iFin,:] = 2.*(fams[:,:,nxs]*dfadmx+fbms[:,:,nxs]*dfbdmx)
    1098         dFdui[iBeg:iFin] = 2.*np.sum(fams[:,:,nxs]*dfadui+fbms[:,:,nxs]*dfbdui,axis=0)
    1099         dFdua[iBeg:iFin] = 2.*np.sum(fams[:,:,nxs,nxs]*dfadua+fbms[:,:,nxs,nxs]*dfbdua,axis=0)
     1095        dFdfr[iBeg:iFin] = 2.*np.sum((fams[:,:,nxs]*dfadfr+fbms[:,:,nxs]*dfbdfr)*Mdata/Nops,axis=0) #ok
     1096        dFdx[iBeg:iFin] =  2.*np.sum(fams[:,:,nxs,nxs]*dfadx+fbms[:,:,nxs,nxs]*dfbdx,axis=0)        #ok
     1097        dFdMx[:,iBeg:iFin,:] = 2.*(fams[:,:,nxs]*dfadmx+fbms[:,:,nxs]*dfbdmx)                       #problems
     1098        dFdui[iBeg:iFin] = 2.*np.sum(fams[:,:,nxs]*dfadui+fbms[:,:,nxs]*dfbdui,axis=0)              #ok
     1099        dFdua[iBeg:iFin] = 2.*np.sum(fams[:,:,nxs,nxs]*dfadua+fbms[:,:,nxs,nxs]*dfbdua,axis=0)      #problems U12 & U23 in sarc
    11001100#        GSASIIpath.IPyBreak()
    11011101        iBeg += blkSize
  • trunk/imports/G2phase.py

    r2486 r2534  
    309309                    elif key[11:] == 'M' and key[6:8] == 'AT':
    310310                        S = EXPphase[key]
    311                         Atoms[-1][7:10] = [float(S[:10]),float(S[10:20]),float(S[20:30])]
     311                        Atoms[-1] = Atom[:7]+[float(S[:10]),float(S[10:20]),float(S[20:30])]+Atom[7:]
    312312        elif Ptype == 'macromolecular':
    313313            for key in keyList:
Note: See TracChangeset for help on using the changeset viewer.