Ignore:
Timestamp:
Feb 20, 2021 2:44:46 PM (9 months ago)
Author:
vondreele
Message:

add new refinable RB parameter for atom site fraction - always there; can be used in constraints.. Available for residue & vector style RBs
fixes to delete RB routines
fixes to RB naming when adding RB to structure
Implement use of view position for new RB origin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIstrMath.py

    r4682 r4824  
    5252def ApplyRBModels(parmDict,Phases,rigidbodyDict,Update=False):
    5353    ''' Takes RB info from RBModels in Phase and RB data in rigidbodyDict along with
    54     current RB values in parmDict & modifies atom contents (xyz & Uij) of parmDict
     54    current RB values in parmDict & modifies atom contents (fxyz & Uij) of parmDict
    5555    '''
    5656    atxIds = ['Ax:','Ay:','Az:']
     
    9292                RBObj['Orient'][0][i] = parmDict[pfx+po+rbsx]
    9393            RBObj['Orient'][0] = G2mth.normQ(RBObj['Orient'][0])
     94            RBObj['AtomFrac'][0] = parmDict[pfx+'RBf:'+rbsx]
    9495            TLS = RBObj['ThermalMotion']
    9596            if 'T' in TLS[0]:
     
    108109            for i,x in enumerate(XYZ):
    109110                atId = RBObj['Ids'][i]
     111                if parmDict[pfx+'Afrac:'+str(AtLookup[atId])]:
     112                    parmDict[pfx+'Afrac:'+str(AtLookup[atId])] = RBObj['AtomFrac'][0]
    110113                for j in [0,1,2]:
    111114                    parmDict[pfx+atxIds[j]+str(AtLookup[atId])] = x[j]
     
    124127                RBObj['Orient'][0][i] = parmDict[pfx+po+rbsx]               
    125128            RBObj['Orient'][0] = G2mth.normQ(RBObj['Orient'][0])
     129            RBObj['AtomFrac'][0] = parmDict[pfx+'RBf:'+rbsx]
    126130            TLS = RBObj['ThermalMotion']
    127131            if 'T' in TLS[0]:
     
    142146            for i,x in enumerate(XYZ):
    143147                atId = RBObj['Ids'][i]
     148                if parmDict[pfx+'Afrac:'+str(AtLookup[atId])]:
     149                    parmDict[pfx+'Afrac:'+str(AtLookup[atId])] = RBObj['AtomFrac'][0]
    144150                for j in [0,1,2]:
    145151                    parmDict[pfx+atxIds[j]+str(AtLookup[atId])] = x[j]
     
    176182    pfx = str(Phase['pId'])+'::'
    177183    RBModels =  Phase['RBModels']
     184   
    178185    for irb,RBObj in enumerate(RBModels.get('Vector',[])):
    179186        symAxis = RBObj.get('symAxis')
     
    191198        for ia,atId in enumerate(RBObj['Ids']):
    192199            atNum = AtLookup[atId]
     200            if parmDict[pfx+'Afrac:'+str(AtLookup[atId])]:
     201                dFdvDict[pfx+'RBf:'+rbsx] += dFdvDict[pfx+'Afrac:'+str(atNum)]
    193202            dx = 0.00001
    194203            for iv in range(len(VModel['VectMag'])):
     
    237246                dFdvDict[pfx+'RBVU:'+rbsx] += dFdvDict[pfx+'AUiso:'+str(AtLookup[atId])]
    238247
    239 
    240248    for irb,RBObj in enumerate(RBModels.get('Residue',[])):
    241249        symAxis = RBObj.get('symAxis')
     
    260268        for ia,atId in enumerate(RBObj['Ids']):
    261269            atNum = AtLookup[atId]
     270            if parmDict[pfx+'Afrac:'+str(AtLookup[atId])]:
     271                dFdvDict[pfx+'RBf:'+rbsx] += dFdvDict[pfx+'Afrac:'+str(atNum)]
    262272            dx = 0.00001
    263273            for i,name in enumerate(['RBRPx:','RBRPy:','RBRPz:']):
Note: See TracChangeset for help on using the changeset viewer.