Changeset 4435
 Timestamp:
 May 25, 2020 8:57:49 PM (16 months ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIIpwd.py
r4432 r4435 2230 2230 Dups,Fracs = findDup(Phase['Atoms']) 2231 2231 Sfracs = [np.cumsum(fracs) for fracs in Fracs] 2232 ifSfracs = np.any(np.array(Sfracs)1.) 2232 2233 Sample = PWDdata['Sample Parameters'] 2233 2234 Meta['temperature'] = Sample['Temperature'] … … 2240 2241 GB = G2lat.cell2Gmat( newPhase['General']['Cell'][1:7])[0] 2241 2242 RMCPdict['Rmax'] = np.min(np.sqrt(np.array([1./G2lat.calc_rDsq2(H,GB) for H in [[1,0,0],[0,1,0],[0,0,1]]])))/2. 2242 newPhase,Atcodes = G2lat.TransformPhase(Phase,newPhase,Trans,np.zeros(3),np.zeros(3),ifMag=False )2243 newPhase,Atcodes = G2lat.TransformPhase(Phase,newPhase,Trans,np.zeros(3),np.zeros(3),ifMag=False,Force=False) 2243 2244 Natm = np.core.defchararray.count(np.array(Atcodes),'+') #no. atoms in original unit cell 2244 2245 Natm = np.count_nonzero(Natm1) 2245 2246 Atoms = newPhase['Atoms'] 2246 Satoms = G2mth.sortArray(G2mth.sortArray(G2mth.sortArray(Atoms,5),4),3)2247 Datoms = [[atom for atom in Satoms if atom[0] in dup] for dup in Dups]2248 Natoms = []2249 2247 reset = False 2250 for idup,dup in enumerate(Dups): 2251 ldup = len(dup) 2252 datoms = Datoms[idup] 2253 natm = len(datoms) 2254 i = 0 2255 while i < natm: 2256 atoms = datoms[i:i+ldup] 2257 try: 2258 atom = atoms[np.searchsorted(Sfracs[idup],rand.random())] 2259 Natoms.append(atom) 2260 except IndexError: #what about vacancies? 2261 if 'Va' not in Atseq: 2262 reset = True 2263 Atseq.append('Va') 2264 RMCPdict['aTypes']['Va'] = 0.0 2265 atom = atoms[0] 2266 atom[1] = 'Va' 2267 Natoms.append(atom) 2268 i += ldup 2248 2249 if ifSfracs: 2250 Natm = np.core.defchararray.count(np.array(Atcodes),'+') #no. atoms in original unit cell 2251 Natm = np.count_nonzero(Natm1) 2252 Satoms = [] 2253 for i in range(len(Atoms)//Natm): 2254 ind = i*Natm 2255 Satoms.append(G2mth.sortArray(G2mth.sortArray(G2mth.sortArray(Atoms[ind:ind+Natm],5),4),3)) 2256 Natoms = [] 2257 for satoms in Satoms: 2258 for idup,dup in enumerate(Dups): 2259 ldup = len(dup) 2260 natm = len(satoms) 2261 i = 0 2262 while i < natm: 2263 if satoms[i][0] in dup: 2264 atoms = satoms[i:i+ldup] 2265 try: 2266 atom = atoms[np.searchsorted(Sfracs[idup],rand.random())] 2267 Natoms.append(atom) 2268 except IndexError: #what about vacancies? 2269 if 'Va' not in Atseq: 2270 reset = True 2271 Atseq.append('Va') 2272 RMCPdict['aTypes']['Va'] = 0.0 2273 atom = atoms[0] 2274 atom[1] = 'Va' 2275 Natoms.append(atom) 2276 i += ldup 2277 else: 2278 i += 1 2279 else: 2280 Natoms = Atoms 2281 2269 2282 NAtype = np.zeros(len(Atseq)) 2270 2283 for atom in Natoms:
Note: See TracChangeset
for help on using the changeset viewer.