Changeset 4849 for trunk


Ignore:
Timestamp:
Mar 10, 2021 9:07:37 PM (2 years ago)
Author:
toby
Message:

apply symmetry constraints on rigid body origin; show position vars that are fixed on sym-gen tab for constraints; minor bug fixes for missing keys

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIconstrGUI.py

    r4838 r4849  
    649649        rbIds = rigidbodyDict.get('RBIds',{'Vector':[],'Residue':[]})
    650650        rbVary,rbDict = G2stIO.GetRigidBodyModels(rigidbodyDict,Print=False)
    651         Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtables,BLtables,MFtables,maxSSwave = G2stIO.GetPhaseData(
    652             Phases,RestraintDict=None,rbIds=rbIds,Print=False) # generates atom symmetry constraints
     651        (Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtables,
     652             BLtables,MFtables,maxSSwave) = G2stIO.GetPhaseData(
     653                 Phases,RestraintDict=None,rbIds=rbIds,Print=False) # generates atom symmetry constraints
    653654        return constDictList,phaseDict,fixedList
    654655           
     
    10371038        if name == 'Sym-Generated':         #show symmetry generated constraints
    10381039            Sizer1 =  wx.BoxSizer(wx.VERTICAL)
     1040            if symHolds:
     1041                Sizer1.Add(wx.StaticText(pageDisplay,wx.ID_ANY,
     1042                    'Position variables fixed by space group symmetry'))
     1043                Sizer1.Add((-1,5))
     1044                Sizer = wx.FlexGridSizer(0,2,0,0)
     1045                Sizer1.Add(Sizer)
     1046                for var in symHolds:
     1047                    Sizer.Add(wx.StaticText(pageDisplay,wx.ID_ANY,'  FIXED'),
     1048                              0,WACV|wx.ALIGN_CENTER|wx.RIGHT|wx.LEFT,3)
     1049                    Sizer.Add(wx.StaticText(pageDisplay,wx.ID_ANY,var))
     1050                    Sizer.Add((-1,-1))
     1051                    Sizer.Add((-1,2))
     1052            else:
     1053                Sizer1.Add(wx.StaticText(pageDisplay,wx.ID_ANY,
     1054                    'No holds generated'))
     1055            Sizer1.Add((-1,10))
     1056            symGen = G2mv.GetSymEquiv()
     1057            if len(symGen) == 0:
     1058                Sizer1.Add(wx.StaticText(pageDisplay,wx.ID_ANY,
     1059                    'No equvalences generated'))
     1060                return Sizer1
    10391061            Sizer1.Add(wx.StaticText(pageDisplay,wx.ID_ANY,
    10401062                'Equivalences generated based on cell/space group input'))
     
    10421064            Sizer = wx.FlexGridSizer(0,2,0,0)
    10431065            Sizer1.Add(Sizer)
    1044             for sym in G2mv.GetSymEquiv():
    1045                 Sizer.Add(wx.StaticText(pageDisplay,wx.ID_ANY,'EQUIV'),
     1066            for sym in symGen:
     1067                Sizer.Add(wx.StaticText(pageDisplay,wx.ID_ANY,'  EQUIV'),
    10461068                    0,WACV|wx.ALIGN_CENTER|wx.RIGHT|wx.LEFT,3)
    10471069                Sizer.Add(wx.StaticText(pageDisplay,wx.ID_ANY,sym))
     
    14021424
    14031425    # create a list of the phase variables
    1404     Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtable,BLtable,MFtable,maxSSwave = G2stIO.GetPhaseData(Phases,rbIds=rbIds,Print=False)
     1426    symHolds = []
     1427    (Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtable,BLtable,
     1428         MFtable,maxSSwave) = G2stIO.GetPhaseData(
     1429             Phases,rbIds=rbIds,Print=False,symHold=symHolds)
    14051430    phaseList = []
    14061431    for item in phaseDict:
  • trunk/GSASIIphsGUI.py

    r4847 r4849  
    1054910549                rbType = data['testRBObj']['rbType']
    1055010550                rbNames = []
    10551                 for item in data['RBModels'][rbType]:
     10551                for item in data['RBModels'].get(rbType,[]):
    1055210552                    rbNames.append(item['RBname'])
    1055310553                rbObj['Ids'] = Ids          #atomids
  • trunk/GSASIIstrIO.py

    r4840 r4849  
    11361136##### Phase data
    11371137################################################################################                   
    1138 def GetPhaseData(PhaseData,RestraintDict={},rbIds={},Print=True,pFile=None,seqRef=False):
     1138def GetPhaseData(PhaseData,RestraintDict={},rbIds={},Print=True,pFile=None,
     1139                 seqRef=False,symHold=None):
    11391140    '''Setup the phase information for a structural refinement, used for
    11401141    regular and sequential refinements, optionally printing information
     
    13711372        pstr = ['x','y','z']
    13721373        ostr = ['a','i','j','k']
     1374        Sytsym = G2spc.SytSym(RB['Orig'][0],SGData)[0]
     1375        xId,xCoef = G2spc.GetCSxinel(Sytsym) # gen origin site sym
     1376        equivs = [[],[],[]]
    13731377        for i in range(3):
    13741378            name = pfxRB+pstr[i]+':'+str(iRB)+':'+rbid
    13751379            phaseDict[name] = RB['Orig'][0][i]
    13761380            if RB['Orig'][1]:
    1377                 phaseVary += [name,]
     1381                if xId[i] > 0:                               
     1382                    phaseVary += [name,]
     1383                    equivs[xId[i]-1].append([name,xCoef[i]])
     1384                elif symHold is not None: #variable is held due to symmetry
     1385                    symHold.append(name)
     1386        for equiv in equivs:
     1387            if len(equiv) > 1:
     1388                name = equiv[0][0]
     1389                coef = equiv[0][1]
     1390                for eqv in equiv[1:]:
     1391                    eqv[1] /= coef
     1392                    G2mv.StoreEquivalence(name,(eqv,))
    13781393        pfxRB = pfx+'RB'+rbKey+'O'
    13791394        A,V = G2mth.Q2AV(RB['Orig'][0])
     
    15321547                            phaseVary.append(names[j])
    15331548                            equivs[xId[j]-1].append([names[j],xCoef[j]])
     1549                        elif symHold is not None: #variable is held due to symmetry
     1550                            symHold.append(names[j])
    15341551                    for equiv in equivs:
    15351552                        if len(equiv) > 1:
  • trunk/GSASIIstrMain.py

    r4843 r4849  
    509509            #phase['Histograms'][h]
    510510            if not phase['Histograms'][h]['Use']: continue
    511             if phase['Histograms'][h]['LeBail']:
     511            if phase['Histograms'][h].get('LeBail',False):
    512512                 return True
    513513    return False
Note: See TracChangeset for help on using the changeset viewer.