Changeset 4849 for trunk/GSASIIstrIO.py


Ignore:
Timestamp:
Mar 10, 2021 9:07:37 PM (7 months 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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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:
Note: See TracChangeset for help on using the changeset viewer.