Changeset 4854 for trunk


Ignore:
Timestamp:
Mar 16, 2021 7:21:46 PM (2 years ago)
Author:
vondreele
Message:

apply scheme used for Uiso symmetry constraints to all other symmetry constraints.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIstrIO.py

    r4853 r4854  
    15431543                        xId,xCoef = G2spc.GetCSxinel(at[cs])
    15441544                    names = [pfx+'dAx:'+str(i),pfx+'dAy:'+str(i),pfx+'dAz:'+str(i)]
    1545                     equivs = [[],[],[]]
     1545                    equivs = {1:[],2:[],3:[]}
    15461546                    for j in range(3):
    15471547                        if xId[j] > 0:                               
    15481548                            phaseVary.append(names[j])
    1549                             equivs[xId[j]-1].append([names[j],xCoef[j]])
     1549                            equivs[xId[j]].append([names[j],xCoef[j]])
    15501550                        elif symHold is not None: #variable is held due to symmetry
    15511551                            symHold.append(names[j])
    15521552                    for equiv in equivs:
    1553                         if len(equiv) > 1:
    1554                             name = equiv[0][0]
    1555                             coef = equiv[0][1]
    1556                             for eqv in equiv[1:]:
     1553                        if len(equivs[equiv]) > 1:
     1554                            name = equivs[equiv][0][0]
     1555                            coef = equivs[equiv][0][1]
     1556                            for eqv in equivs[equiv][1:]:
    15571557                                eqv[1] /= coef
    15581558                                G2mv.StoreEquivalence(name,(eqv,))
     
    15851585                    mId,mCoef = G2spc.GetCSpqinel(SpnFlp,dupDir)
    15861586                    names = [pfx+'AMx:'+str(i),pfx+'AMy:'+str(i),pfx+'AMz:'+str(i)]
    1587                     equivs = [[],[],[]]
     1587                    equivs = {1:[],2:[],3:[]}
    15881588                    for j in range(3):
    15891589                        if mId[j] > 0:
    15901590                            phaseVary.append(names[j])
    1591                             equivs[mId[j]-1].append([names[j],mCoef[j]])
     1591                            equivs[mId[j]].append([names[j],mCoef[j]])
    15921592                    for equiv in equivs:
    1593                         if len(equiv) > 1:
    1594                             name = equiv[0][0]
    1595                             coef = equiv[0][1]
    1596                             for eqv in equiv[1:]:
     1593                        if len(equivs[equiv]) > 1:
     1594                            name = equivs[equiv][0][0]
     1595                            coef = equivs[equiv][0][1]
     1596                            for eqv in equivs[equiv][1:]:
    15971597                                eqv[1] /= coef
    15981598                                G2mv.StoreEquivalence(name,(eqv,))
     
    16191619                                if waveType in ['ZigZag','Block',] and not iw:
    16201620                                    names = [pfx+'Tmin:'+stiw,pfx+'Tmax:'+stiw,pfx+'Xmax:'+stiw,pfx+'Ymax:'+stiw,pfx+'Zmax:'+stiw]
    1621                                     equivs = [[],[], [],[],[]]
     1621                                    equivs = {1:[],2:[], 3:[],4:[],5:[]}
    16221622                                else:
    16231623                                    names = [pfx+'Xsin:'+stiw,pfx+'Ysin:'+stiw,pfx+'Zsin:'+stiw,
    16241624                                        pfx+'Xcos:'+stiw,pfx+'Ycos:'+stiw,pfx+'Zcos:'+stiw]
    1625                                     equivs = [[],[],[], [],[],[]]
     1625                                    equivs = {1:[],2:[],3:[], 4:[],5:[],6:[]}
    16261626                            elif Stype == 'Sadp':
    16271627                                names = [pfx+'U11sin:'+stiw,pfx+'U22sin:'+stiw,pfx+'U33sin:'+stiw,
     
    16291629                                    pfx+'U11cos:'+stiw,pfx+'U22cos:'+stiw,pfx+'U33cos:'+stiw,
    16301630                                    pfx+'U12cos:'+stiw,pfx+'U13cos:'+stiw,pfx+'U23cos:'+stiw]
    1631                                 equivs = [[],[],[],[],[],[], [],[],[],[],[],[]]
     1631                                equivs = {1:[],2:[],3:[],4:[],5:[],6:[], 7:[],8:[],9:[],10:[],11:[],12:[]}
    16321632                            elif Stype == 'Sfrac':
    1633                                 equivs = [[],[]]
     1633                                equivs = {1:[],2:[]}
    16341634                                if 'Crenel' in waveType and not iw:
    16351635                                    names = [pfx+'Fzero:'+stiw,pfx+'Fwid:'+stiw]
     
    16371637                                    names = [pfx+'Fsin:'+stiw,pfx+'Fcos:'+stiw]
    16381638                            elif Stype == 'Smag':
    1639                                 equivs = [[],[],[], [],[],[]]
     1639                                equivs = {1:[],2:[],3:[], 4:[],5:[],6:[]}
    16401640                                names = [pfx+'MXsin:'+stiw,pfx+'MYsin:'+stiw,pfx+'MZsin:'+stiw,
    16411641                                    pfx+'MXcos:'+stiw,pfx+'MYcos:'+stiw,pfx+'MZcos:'+stiw]
     
    16451645                                    if uId[j][0] > 0:                               
    16461646                                        phaseVary.append(names[j])
    1647                                         equivs[uId[j][0]-1].append([names[j],uCoef[j][0]])
     1647                                        equivs[uId[j][0]].append([names[j],uCoef[j][0]])
    16481648                                for equiv in equivs:
    1649                                     if len(equiv) > 1:
    1650                                         name = equiv[0][0]
    1651                                         coef = equiv[0][1]
    1652                                         for eqv in equiv[1:]:
     1649                                    if len(equivs[equiv]) > 1:
     1650                                        name = equivs[equiv][0][0]
     1651                                        coef = equivs[equiv][0][1]
     1652                                        for eqv in equivs[equiv][1:]:
    16531653                                            eqv[1] /= coef
    16541654                                            G2mv.StoreEquivalence(name,(eqv,))
Note: See TracChangeset for help on using the changeset viewer.