Changeset 4723


Ignore:
Timestamp:
Jan 5, 2021 4:22:19 PM (9 months ago)
Author:
vondreele
Message:

add automatic valence bond sum calculator to dist/angle calculator in Atoms tab

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIstrMain.py

    r4709 r4723  
    3737import GSASIIobj as G2obj
    3838import GSASIIfiles as G2fil
     39import GSASIIElem as G2elem
     40import atmdata
    3941
    4042sind = lambda x: np.sin(x*np.pi/180.)
     
    10191021            line += '%12s'%(AtomLabels[dist[0]].center(12))
    10201022        MyPrint('  To       cell +(sym. op.)      dist.  '+line.rstrip())
     1023        BVS = {}
     1024        BVdat = {}
     1025        Otyp = G2elem.FixValence(Oatom[2]).split('+')[0].split('-')[0]
     1026        BVox = [BV for BV in atmdata.BVSoxid[Otyp] if '+' in BV]
     1027        if len(BVox):
     1028            BVS = {BV:0.0 for BV in BVox}
     1029            BVdat = {BV:dict(zip(['O','F','Cl'],atmdata.BVScoeff[BV])) for BV in BVox}
     1030            pvline = 'Bond Valence sums for: '
    10211031        for i,dist in enumerate(Dist):
    10221032            line = ''
     
    10351045            else:
    10361046                val = '%8.4f'%(dist[3])
     1047            if len(BVox):
     1048                Tatm = G2elem.FixValence(DisAglData['TargAtoms'][dist[0]][2]).split('-')[0]
     1049                if Tatm in ['O','F','Cl']:
     1050                    for BV in BVox:
     1051                        BVS[BV] += np.exp((BVdat[BV][Tatm]-dist[3])/0.37)               
    10371052            tunit = '[%2d%2d%2d]'% dist[1]
    10381053            MyPrint(('  %8s%10s+(%4d) %12s'%(AtomLabels[dist[0]].ljust(8),tunit.ljust(10),dist[2],val.center(12)))+line.rstrip())
     1054        if len(BVox):
     1055            MyPrint(80*'*')
     1056            for BV in BVox:
     1057                pvline += ' %s: %.3f  '%(BV,BVS[BV])
     1058            MyPrint(pvline)
    10391059
    10401060def DisAglTor(DATData):
  • trunk/atmdata.py

    r4670 r4723  
    403403    'Lu':['Lu+3',],
    404404    'Mg':['Mg+2',],
    405     'Mn':['Mn+2','Mn+3',',Mn+4','Mn+7',],
     405    'Mn':['Mn+2','Mn+3','Mn+4','Mn+7',],
    406406    'Mo':['Mo+6',],
    407407    'N' :['N+5','N+3','N-3',],
Note: See TracChangeset for help on using the changeset viewer.