Changeset 1987
- Timestamp:
- Oct 6, 2015 9:27:27 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIImath.py
r1984 r1987 1042 1042 1043 1043 Ax = np.array(XSSdata[:3]).T #atoms x waves x sin pos mods 1044 dGdAx = np.zeros_like(Ax) 1044 1045 Bx = np.array(XSSdata[3:]).T #...cos pos mods 1046 dGdBx = np.zeros_like(Bx) 1045 1047 Af = np.array(FSSdata[0]).T #sin frac mods x waves x atoms 1048 dGdAf = np.zeros_like(Af) 1046 1049 Bf = np.array(FSSdata[1]).T #cos frac mods... 1050 dGdBf = np.zeros_like(Bf) 1047 1051 Au = Mast*np.array(G2lat.U6toUij(USSdata[:6])).T #atoms x waves x sin Uij mods 1052 dGdAu = np.zeros_like(Au) 1048 1053 Bu = Mast*np.array(G2lat.U6toUij(USSdata[6:])).T #...cos Uij mods 1054 dGdBu = np.zeros_like(Bu) 1049 1055 GpA = np.array(expModInt(SSUniq,Af,Bf,Ax,Bx,Au,Bu)) 1050 return GpA # 2 x SGops x atoms1056 return GpA,dGdAf,dGdBf,dGdAx,dGdBx,dGdAu,dGdBu 1051 1057 1052 1058 def posFourier(tau,psin,pcos,smul): -
trunk/GSASIIstrMath.py
r1986 r1987 1271 1271 fot = (FF+FP-Bab)*occ*Tcorr #ops x atoms 1272 1272 fotp = FPP*occ*Tcorr #ops x atoms 1273 GfpuA = G2mth.ModulationDerv(waveTypes,Uniq,FSSdata,XSSdata,USSdata,Mast)1274 #need ModulationDerv here dGAdXsin, etc1273 GfpuA,dGdAf,dGdBf,dGdAx,dGdBx,dGdAu,dGdBu = \ 1274 G2mth.ModulationDerv(waveTypes,Uniq,FSSdata,XSSdata,USSdata,Mast) 1275 1275 fa = np.array([((FF+FP).T-Bab).T*cosp*Tcorr,-Flack*FPP*sinp*Tcorr]) # array(2,nTwin,nEqv,nAtoms) 1276 1276 fb = np.array([((FF+FP).T-Bab).T*sinp*Tcorr,Flack*FPP*cosp*Tcorr]) … … 1289 1289 dfadui = np.sum(-SQfactor*fag,axis=1) 1290 1290 if nTwin > 1: 1291 dfadx = np.array([np.sum(twopi*Uniq[it ]*np.swapaxes(fax,-2,-1)[:,it,:,:,np.newaxis],axis=-2) for it in range(nTwin)])1291 dfadx = np.array([np.sum(twopi*Uniq[it,:,:3]*np.swapaxes(fax,-2,-1)[:,it,:,:,np.newaxis],axis=-2) for it in range(nTwin)]) 1292 1292 dfadua = np.array([np.sum(-Hij[it]*np.swapaxes(fa,-2,-1)[:,it,:,:,np.newaxis],axis=-2) for it in range(nTwin)]) 1293 1293 # array(nTwin,2,nAtom,3) & array(nTwin,2,nAtom,6) 1294 1294 else: 1295 dfadx = np.sum(twopi*Uniq *np.swapaxes(fax,-2,-1)[:,:,:,np.newaxis],axis=-2)1295 dfadx = np.sum(twopi*Uniq[:,:3]*np.swapaxes(fax,-2,-1)[:,:,:,np.newaxis],axis=-2) 1296 1296 dfadua = np.sum(-Hij*np.swapaxes(fa,-2,-1)[:,:,:,np.newaxis],axis=-2) 1297 1297 # array(2,nAtom,3) & array(2,nAtom,6)
Note: See TracChangeset
for help on using the changeset viewer.