Changeset 3790 for trunk/GSASIIconstrGUI.py
 Timestamp:
 Jan 19, 2019 9:42:46 PM (4 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIIconstrGUI.py
r3789 r3790 1411 1411 1412 1412 #how do I do Uij's for most Trans? 1413 1413 1414 # constraints on lattice parameters between phases 1414 1415 T = nl.inv(Trans).T 1415 1416 conMat = [ … … 1437 1438 # Gnew = (Tr.T*G)*Tr 1438 1439 1440 #print('old A',G2lat.cell2A(oldPhase['General']['Cell'][1:7])) 1441 #print('new A',G2lat.cell2A(newPhase['General']['Cell'][1:7])) 1439 1442 for iAnew,Asi in enumerate(['A0','A1','A2','A3','A4','A5']): # loop through A[i] for new cell 1440 1443 Nparm = str(npId) + '::' + Asi 1441 if Nparm != SetUniqAj(npId,iAnew,nSGData): continue # skip if already constrainted 1444 if Nparm != SetUniqAj(npId,iAnew,nSGData): 1445 continue # skip: Ai constrained from Aj or must be zero 1442 1446 multDict = {} 1443 1447 for iAorg in range(6): … … 1445 1449 if abs(cA) < 1.e8: continue 1446 1450 parm = SetUniqAj(opId,iAorg,oSGData) # translate to unique A[i] in original cell 1447 if not parm: continue 1451 if not parm: continue # must be zero 1448 1452 # sum coeff 1449 1453 if parm in multDict: … … 1455 1459 for i in multDict: 1456 1460 maxMult = max(maxMult,abs(multDict[i])) 1457 if maxMult <= 0: continue 1458 1459 # create constraint (if needed) or equivalence 1460 if len(multDict) == 1: 1461 if maxMult <= 0: # Nparm computes as zero; Fix this parameter 1462 constraints['Phase'] += [[ 1463 [0.0,G2obj.G2VarObj(Nparm)], 1464 None,None,'h']] 1465 elif len(multDict) == 1: # create equivalence 1461 1466 key = list(multDict.keys())[0] 1462 constr =[1467 constraints['Phase'] += [[ 1463 1468 [1.0,G2obj.G2VarObj(key)], 1464 1469 [multDict[key],G2obj.G2VarObj(Nparm)], 1465 None,None,'e'] 1466 else: 1470 None,None,'e']] 1471 else: # create constraint 1467 1472 constr = [[1.0,G2obj.G2VarObj(Nparm)]] 1468 1473 for key in multDict: 1469 1474 constr += [[multDict[key],G2obj.G2VarObj(key)]] 1470 1475 constr += [0.0,None,'c'] 1471 constraints['Phase'] += [constr]1476 constraints['Phase'] += [constr] 1472 1477 1473 1478 # constraints on HAP Scale, etc.
Note: See TracChangeset
for help on using the changeset viewer.