Ignore:
Timestamp:
Jun 6, 2019 12:13:45 AM (3 years ago)
Author:
vondreele
Message:

fix problem if magcells True but no list of them (in Unit Cells List)
some cleanup in incommensurate mag str. fctr.; comment some dead code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIstrMath.py

    r3906 r4016  
    15121512        Tmag,TmagA,TmagB = G2mth.MagMod(ngl,mXYZ,modQ,MSSdata,SGData,SSGData)   #Ntau,Nops,Natm,Mxyz-Tmag matches drawing moments
    15131513       
    1514         if not SGData['SGGray']:
     1514        if not SGData['SGGray']:    #for fixed Mx,My,Mz
    15151515            Mmod += Gdata.T[:,nxs,:]
    15161516            GSdata = np.inner(Gdata.T,np.swapaxes(SGMT,1,2))  #apply sym. ops.--> Natm,Nops,Nxyz
     
    15201520            GSdata = SGData['MagMom'][nxs,:,nxs]*GSdata   #flip vectors according to spin flip * det(opM)
    15211521            GSdata = np.swapaxes(GSdata,0,1)    #Nop,Natm,Mxyz
    1522             Tmag += Gdata.T[nxs,nxs,:,:]
    1523            
    1524         TmagC = np.inner(Tmag,uAmat.T)   #make cartesian; Ntau,Nops,Natm,,Mxyz
    1525         Smag = np.sqrt(np.sum(TmagC**2,axis=-1))
    1526         Kmag = TmagC/Smag[:,:,:,nxs]
     1522#            Tmag += Gdata.T[nxs,nxs,:,:]
     1523#           
     1524#        TmagC = np.inner(Tmag,uAmat.T)   #make cartesian; Ntau,Nops,Natm,,Mxyz
     1525#        Smag = np.sqrt(np.sum(TmagC**2,axis=-1))
     1526#        Kmag = TmagC/Smag[:,:,:,nxs]
    15271527
    15281528    FF = np.zeros(len(Tdata))
     
    16051605            fas0 = 0.
    16061606            fbs0 = 0.
    1607             if not SGData['SGGray']:                     
     1607            if not SGData['SGGray']:     #correct -fixed Mx,My,Mz contribution             
    16081608                fam0 = TMcorr[:,nxs,:,nxs]*GSdata[nxs,:,:,:]*cosm[:,:,:,nxs]    #Nref,Nops,Natm,Mxyz
    16091609                fbm0 = TMcorr[:,nxs,:,nxs]*GSdata[nxs,:,:,:]*sinm[:,:,:,nxs]   
     
    16161616#for modulated moments --> m != 0 reflections
    16171617            M = np.array(np.abs(H[3]),dtype=np.int)-1
    1618             fam = TMcorr[:,nxs,nxs,:,nxs]*np.array([np.where(M[i]>=0,(TmagA*cosm[i,nxs,:,:,nxs]-np.sign(H[3])[i]*TmagB*sinm[i,nxs,:,:,nxs]),0.) for i in range(mRef)])
    1619             fbm = TMcorr[:,nxs,nxs,:,nxs]*np.array([np.where(M[i]>=0,(TmagA*sinm[i,nxs,:,:,nxs]+np.sign(H[3])[i]*TmagB*cosm[i,nxs,:,:,nxs]),0.) for i in range(mRef)])
     1618       
     1619            fam = TMcorr[:,nxs,nxs,:,nxs]*np.array([np.where(M[i]>=0,(TmagB*cosm[i,nxs,:,:,nxs]-    \
     1620                np.sign(H[3,i])*TmagA*sinm[i,nxs,:,:,nxs]),0.) for i in range(mRef)])
     1621            fbm = TMcorr[:,nxs,nxs,:,nxs]*np.array([np.where(M[i]>=0,(TmagB*sinm[i,nxs,:,:,nxs]+    \
     1622                np.sign(H[3,i])*TmagA*cosm[i,nxs,:,:,nxs]),0.) for i in range(mRef)])
    16201623                       
    16211624            famq = np.sum(np.sum(fam/2.,axis=-2),axis=-2)      #Nref,Mxyz; sum ops & atoms
Note: See TracChangeset for help on using the changeset viewer.