Changeset 4055
- Timestamp:
- Jul 7, 2019 5:14:44 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIImath.py
r4054 r4055 1416 1416 if SGData['SGInv']: 1417 1417 SGMT = np.vstack((SGMT,-SGMT)) 1418 Sinv = np.vstack((Sinv,-Sinv))1418 Sinv = np.vstack((Sinv,-Sinv)) 1419 1419 SGT = np.vstack((SGT,-SGT)) 1420 1420 SGMT = np.vstack([SGMT for cen in SGData['SGCen']]) #Nops,3,3 1421 1421 Sinv = np.vstack([Sinv for cen in SGData['SGCen']]) #Nops,4,4 1422 1422 SGT = np.vstack([SGT+cen for cen in SSGData['SSGCen']])%1. 1423 detSM = nl.det(SGMT) #Nops1424 1423 epsinv = Sinv[:,3,3] #Nops 1425 1424 kdr = np.inner(XYZ,modQ).T #Nops,Natm 1426 phase = kdr+(epsinv*(np.inner( modQ,SGT[:,:3])-SGT[:,3]))[:,nxs] #Nops,Natm1425 phase = kdr+(epsinv*(np.inner(SGT[:,:3],modQ)-SGT[:,3]))[:,nxs] #Nops,Natm 1427 1426 1428 1427 psin = np.sin(twopi*phase) #Nops,Natm … … 1430 1429 MmodB = np.sum(Bm[nxs,:,:,:]*pcos[:,:,nxs,nxs],axis=2) #Nops,Natm,3 1431 1430 MmodA = np.sum(Am[nxs,:,:,:]*psin[:,:,nxs,nxs],axis=2) 1432 # if SGData['SGGray']:1433 # MmodA = -np.sum(SGMT[:,nxs,:,:]*MmodA[:,:,nxs,:],axis=-1)*detSM[:,nxs,nxs]*SGData['SpnFlp'][:,nxs,nxs]1434 # MmodB = -np.sum(SGMT[:,nxs,:,:]*MmodB[:,:,nxs,:],axis=-1)*detSM[:,nxs,nxs]*SGData['SpnFlp'][:,nxs,nxs]1435 # else:1436 1431 MmodA = np.sum(SGMT[:,nxs,:,:]*MmodA[:,:,nxs,:],axis=-1)*SGData['MagMom'][:,nxs,nxs] 1437 1432 MmodB = np.sum(SGMT[:,nxs,:,:]*MmodB[:,:,nxs,:],axis=-1)*SGData['MagMom'][:,nxs,nxs] 1438 Mmod = MmodA+MmodB 1439 return Mmod,MmodA,MmodB #Nops,Natm,,Mxyz; sum,sin & cos parts 1433 return MmodA,MmodB #Nops,Natm,,Mxyz; sin & cos parts 1440 1434 1441 1435 def Modulation(H,HP,nWaves,Fmod,Xmod,Umod,glTau,glWt): -
trunk/GSASIIstrMath.py
r4054 r4055 1510 1510 1511 1511 mXYZ = np.array([[xyz[0] for xyz in list(G2spc.GenAtom(xyz,SGData,All=True,Move=True))] for xyz in (Xdata+dXdata).T])%1. #Natn,Nop,xyz 1512 Tmag ,TmagA,TmagB = G2mth.MagMod2(mXYZ,modQ,MSSdata,SGData,SSGData) #Nops,Natm,Mxyz-Tmag matches drawing moments1512 TmagA,TmagB = G2mth.MagMod2(mXYZ,modQ,MSSdata,SGData,SSGData) #Nops,Natm,Mxyz-Tmag matches drawing moments 1513 1513 1514 1514 if not SGData['SGGray']: #for fixed Mx,My,Mz … … 1614 1614 fam = TMcorr[:,nxs,:,nxs]*np.array([np.where(M[i]>=0,(TmagB*cosm[i,:,:,nxs]- \ 1615 1615 np.sign(H[3,i])*TmagA*sinm[i,:,:,nxs]),0.) for i in range(mRef)]) 1616 1616 1617 fbm = TMcorr[:,nxs,:,nxs]*np.array([np.where(M[i]>=0,(TmagB*sinm[i,:,:,nxs]+ \ 1617 1618 np.sign(H[3,i])*TmagA*cosm[i,:,:,nxs]),0.) for i in range(mRef)])
Note: See TracChangeset
for help on using the changeset viewer.