Changeset 3721


Ignore:
Timestamp:
Nov 7, 2018 8:38:23 AM (3 years ago)
Author:
vondreele
Message:

put in (now commented out) new code for making lattice constraints for magnetic phases - still doesn't work correctly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIconstrGUI.py

    r3717 r3721  
    13791379           
    13801380        #how do I do Uij's for most Trans?
     1381       
    13811382#unfortunately, this doesn't always work!
    13821383#    As = ['A0','A1','A2','A3','A4','A5']
    13831384#    Aids = [[0,0,'A0'],[1,1,'A1'],[2,2,'A2'],[0,1,'A3'],[0,2,'A4'],[1,2,'A5']]
    13841385#    DepConsDict = dict(zip(As,[[],[],[],[],[],[]]))
     1386#    T = Trans
     1387##Symbolic code:
     1388#    '''
     1389#         T00**2*a0  T01**2*a1 T02**2*a2 T00*T01*a3    T00*T02*a4    T01*T02*a5
     1390#         T10**2*a0  T11**2*a1 T12**2*a2 T10*T11*a3    T10*T12*a4    T11*T12*a5
     1391#         T20**2*a0  T21**2*a1 T22**2*a2 T20*T21*a3    T20*T22*a4    T21*T22*a5
     1392#         2*T00*T10*a0      2*T01*T11*a1     2*T02*T12*a2     (T00*T11 + T01*T10)*a3      (T00*T12 + T02*T10)*a4      (T01*T12 + T02*T11)*a5
     1393#         2*T00*T20*a0      2*T01*T21*a1     2*T02*T22*a2     (T00*T21 + T01*T20)*a3      (T00*T22 + T02*T20)*a4      (T01*T22 + T02*T21)*a5
     1394#         2*T10*T20*a0      2*T11*T21*a1     2*T12*T22*a2     (T10*T21 + T11*T20)*a3      (T10*T22 + T12*T20)*a4      (T11*T22 + T12*T21)*a5
     1395#    '''
     1396#    conMat = [
     1397#        [T[0,0]**2,T[0,1]**2,T[0,2]**2,T[0,0]*T[0,1],T[0,0]*T[0,2],T[0,1]*T[0,2]],
     1398#        [T[1,0]**2,T[1,1]**2,T[1,2]**2,T[1,0]*T[1,1],T[1,0]*T[1,2],T[1,1]*T[1,2]],
     1399#        [T[2,0]**2,T[2,1]**2,T[2,2]**2,T[2,0]*T[2,1],T[2,0]*T[2,2],T[2,1]*T[2,2]],
     1400#        [2.*T[0,0]*T[1,0],2.*T[0,1]*T[1,1],2.*T[0,2]*T[1,2],T[0,0]*T[1,1]+T[0,1]*T[1,0],T[0,0]*T[1,2]+T[0,2]*T[1,0],T[0,1]*T[1,2]+T[0,2]*T[1,1]],
     1401#        [2.*T[0,0]*T[2,0],2.*T[0,1]*T[2,1],2.*T[0,2]*T[2,2],T[0,0]*T[2,1]+T[0,1]*T[2,0],T[0,0]*T[2,2]+T[0,2]*T[2,0],T[0,1]*T[2,2]+T[0,2]*T[2,1]],
     1402#        [2.*T[1,0]*T[2,0],2.*T[1,1]*T[2,1],2.*T[1,2]*T[2,2],T[1,0]*T[2,1]+T[1,1]*T[2,0],T[1,0]*T[2,2]+T[1,2]*T[2,0],T[1,1]*T[2,2]+T[1,2]*T[2,1]]]
     1403#   
    13851404#    for iA,Aid in enumerate(Aids):
    1386 #        GT = np.zeros((3,3))
    13871405#        if abs(nAcof[iA]) > 1.e-8:
    1388 #            GT[Aid[0],Aid[1]] = 1.
    1389 #            nGT = G2lat.prodMGMT(GT,Trans)
    1390 #            nAT = G2lat.Gmat2A(nGT)
    1391 #            for ia,nA in enumerate(nAT):
    1392 #                if abs(nA) > 1.e-8 and abs(nAcof[ia]) > 1.e-8:
     1406#            for ia in [0,1,2,3,4,5]:
     1407#                cA = conMat[ia][iA]
     1408#                if abs(cA) > 1.e-8:
    13931409#                    parm = SetUniqAj(npId,As[ia],nSGData['SGLaue'])
    1394 #                    DepConsDict[Aid[2]].append([nA,G2obj.G2VarObj(parm)])
     1410#                    DepConsDict[Aid[2]].append([cA,G2obj.G2VarObj(parm)])
    13951411#    conStrings = []
    13961412#    for iA,Asi in enumerate(As):
     
    14101426#                Dep[0] *= -1
    14111427#            constraints['Phase'].append([IndpCon]+DepConsDict[Asi]+[0.0,None,'c'])
     1428           
    14121429    for hId,hist in enumerate(UseList):    #HAP - seems OK
    14131430        ohapkey = '%d:%d:'%(opId,hId)
Note: See TracChangeset for help on using the changeset viewer.