Ignore:
Timestamp:
Feb 16, 2021 3:17:35 PM (2 years ago)
Author:
vondreele
Message:

Add new routine RBsymCheck to G2lat - it checks RB atom positions for symmetry equivalent duplicates in the RB and sets atom frac=0 if so. Also sets atom sytsym, mult for RB location/orientation. Result is correct total number of atoms in unit cell.
Implement in G2phsGUI in 3 places as needed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIlattice.py

    r4810 r4818  
    1919The "*A* tensor" terms are defined as
    2020:math:`A = (\\begin{matrix} G_{11} & G_{22} & G_{33} & 2G_{12} & 2G_{13} & 2G_{23}\\end{matrix})` and *A* can be used in this fashion:
    21 :math:`d^* = \sqrt {A_0 h^2 + A_1 k^2 + A_2 l^2 + A_3 hk + A_4 hl + A_5 kl}`, where
     21:math:`d^* = \\sqrt {A_0 h^2 + A_1 k^2 + A_2 l^2 + A_3 hk + A_4 hl + A_5 kl}`, where
    2222*d* is the d-spacing, and :math:`d^*` is the reciprocal lattice spacing,
    2323:math:`Q = 2 \\pi d^* = 2 \\pi / d`.
     
    10691069    else:
    10701070        return True
     1071   
     1072def RBsymCheck(Atoms,ct,cx,cs,AtLookUp,Amat,RBObjIds,SGData):
     1073    """ Checks members of a rigid body to see if one is a symmetry equivalent of another.
     1074    If so the atom site frac is set to zero.
     1075    param: Atoms: atom array as defined in GSAS-II; modified here
     1076    param: ct: int location of atom type in Atoms item
     1077    param: cx: int location of x,y,z,frac in Atoms item
     1078    param: AtLookUp: dict: atom lookup by Id table
     1079    param: Amat: np .array: crystal-to-Cartesian transformationmatri
     1080    param: RBObjIds: list: atom Id belonging to rigid body being tested
     1081    param: SGData: Dict: GSAS-II space group info.
     1082    :return: Atoms with modified atom frac entries
     1083   
     1084    """
     1085    for i,Id in enumerate(RBObjIds):
     1086        XYZo = np.array(Atoms[AtLookUp[Id]][cx:cx+3])%1.
     1087        typo = Atoms[AtLookUp[Id]][ct]
     1088        for Jd in RBObjIds[i+1:]:
     1089            if Atoms[AtLookUp[Jd]][ct] == typo:
     1090                XYZt = Atoms[AtLookUp[Jd]][cx:cx+3]
     1091                Xeqv = list(G2spc.GenAtom(np.array(XYZt)%1.,SGData,True))
     1092                close = [np.allclose(np.inner(Amat,XYZo),np.inner(Amat,eqv[0]),atol=0.01) for eqv in Xeqv]
     1093                if True in close:
     1094                    Atoms[AtLookUp[Jd]][cx+3] = 0.0
     1095        Sytsym,Mult = G2spc.SytSym(Atoms[AtLookUp[Id]][cx:cx+3],SGData)[:2]
     1096        Atoms[AtLookUp[Id]][cs] = Sytsym
     1097        Atoms[AtLookUp[Id]][cs+1] = Mult           
     1098    return Atoms
    10711099                                   
    10721100def GetBraviasNum(center,system):
Note: See TracChangeset for help on using the changeset viewer.