Changeset 4264 for trunk/GSASIIpwd.py


Ignore:
Timestamp:
Jan 23, 2020 10:09:25 AM (21 months ago)
Author:
vondreele
Message:

Add swap atoms to RMCProfile stuff
Handle vacancies

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwd.py

    r4263 r4264  
    22062206    Datoms = [[atom for atom in Satoms if atom[0] in dup] for dup in Dups]
    22072207    Natoms = []
     2208    reset = False
    22082209    for idup,dup in enumerate(Dups):
    22092210        ldup = len(dup)
     
    22172218                Natoms.append(atom)
    22182219            except IndexError:      #what about vacancies?
    2219                 pass
     2220                if 'Va' not in Atseq:
     2221                    reset = True
     2222                    Atseq.append('Va')
     2223                    RMCPdict['aTypes']['Va'] = 0.0
     2224                atom = atoms[0]
     2225                atom[1] = 'Va'
     2226                Natoms.append(atom)
    22202227            i += ldup
    22212228    NAtype = np.zeros(len(Atseq))
    22222229    for atom in Natoms:
    22232230        NAtype[Atseq.index(atom[1])] += 1
    2224     NAstr = ['%d'%i for i in NAtype]
     2231    NAstr = ['%6d'%i for i in NAtype]
    22252232    Cell = newPhase['General']['Cell'][1:7]
    22262233    if os.path.exists(Name+'.his6f'):
     
    22332240    for item in Meta:
    22342241        fl.write('%-20s%s\n'%('Metadata '+item+':',Meta[item]))
    2235     fl.write('Atom types present:             %s\n'%'    '.join(Atseq))
    2236     fl.write('Number of each atom type:       %s\n'%'  '.join(NAstr))
     2242    fl.write('Atom types present:                 %s\n'%'    '.join(Atseq))
     2243    fl.write('Number of each atom type:       %s\n'%''.join(NAstr))
    22372244    fl.write('Number of atoms:                %d\n'%len(Natoms))
    22382245    fl.write('%-35s%4d%4d%4d\n'%('Supercell dimensions:',Supercell[0],Supercell[1],Supercell[2]))
     
    22562263                        nat,atom[1],atcode[0],atom[3],atom[4],atom[5],(iat)%Natm+1,cell[0],cell[1],cell[2]))
    22572264    fl.close()
    2258     return fname
     2265    return fname,reset
    22592266
    22602267def MakeBragg(G2frame,Name,Phase,PWId):
     
    23142321    for pair in [[' %s-%s'%(Atseq[i],Atseq[j]) for j in range(i,lenA)] for i in range(lenA)]:
    23152322        Pairs += pair
    2316     pairMin = [atPairs[pair] for pair in Pairs]
    2317     maxMoves = [Atypes[atm] for atm in Atseq]
     2323    pairMin = [atPairs[pair]for pair in Pairs if pair in atPairs]
     2324    maxMoves = [Atypes[atm] for atm in Atseq if atm in Atypes]
    23182325    fname = Name+'.dat'
    23192326    fl = open(fname,'w')
     
    23762383        fl.write('  > SAVE :: 100000\n')
    23772384        fl.write('  > UPDATE :: 100000\n')
     2385        if len(RMCPdict['Swap']):
     2386            fl.write('\n')
     2387            fl.write('SWAP_MULTI ::\n')
     2388            for swap in RMCPdict['Swap']:
     2389                try:
     2390                    at1 = Atseq.index(swap[0])
     2391                    at2 = Atseq.index(swap[1])
     2392                except ValueError:
     2393                    break
     2394                fl.write('  > SWAP_ATOMS :: %d %d %.2f\n'%(at1,at2,swap[2]))
     2395       
    23782396    for ifx,fxcn in enumerate(RMCPdict['FxCN']):
    23792397        try:
Note: See TracChangeset for help on using the changeset viewer.