Class SpaceGroupFinder


  • public class SpaceGroupFinder
    extends java.lang.Object
    A relatively simple space group finder given a unit cell. The unit cell is used to reduce the options involving hexagonal, tetragonal, and cubic groups. See https://stokes.byu.edu/iso/findsymform.php for finding the space group given no unit cell information.sp
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private SpaceGroupFinder.SGAtom[] atoms  
      private static javajs.util.BS[] bsGroupOps  
      private static javajs.util.BS[] bsOpGroups  
      private static int GROUP_COUNT  
      private static java.lang.String[] groupNames  
      private static int MAX_COUNT
      maximum allowable supercell
      private int nAtoms  
      private static int OP_COUNT  
      private static SymmetryOperation[] ops  
      private static java.lang.String[] opXYZ  
      private javajs.util.P3 pt  
      private static java.io.BufferedReader rdr  
      private static float SLOP0001
      tolerance for fractional coord and
      private static float SLOP001
      tolerance for fractional coord and
      private static float SLOP0014
      maximum allowable distance fx, fy ,fz for atom finder
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private boolean approx0​(float f)  
      private boolean approx000​(float f)  
      private boolean approx0014​(float f)  
      private int approxInt​(float finv)  
      private boolean checkBasis​(javajs.util.BS uncheckedOps, javajs.util.BS bsPoints, javajs.util.BS targets)  
      SymmetryInterface checkSupercell​(Viewer vwr, SymmetryInterface uc, javajs.util.BS bsPoints, int abc, javajs.util.P3 scaling)
      Look for a supercell and adjust lattice down if necessary.
      private void dumpBasis​(javajs.util.BS ops, javajs.util.BS bs1, javajs.util.BS bsPoints)  
      private void filterGroups​(javajs.util.BS bsGroups, float[] params)
      Remove possibilities based on unit cells.
      private int findEquiv​(int iop, SymmetryOperation op, int i, javajs.util.BS bsPoints, javajs.util.P3 pt, boolean andClear)  
      java.lang.Object findSpaceGroup​(Viewer vwr, javajs.util.BS atoms0, java.lang.String xyzList, float[] unitCellParams, SymmetryInterface uc, boolean asString, boolean isAssign)  
      private java.lang.Object getGroupsWithOps​(java.lang.String xyzList, float[] unitCellParams, boolean isAssign)
      Find all space groups that match EXACTLY or contain all of the operations specified.
      private static java.lang.String[] getList​(Viewer vwr, java.lang.Object me, java.lang.String[] list, java.lang.String fileName)  
      private static SymmetryOperation getOp​(int iop)  
      private boolean latticeShift​(javajs.util.P3 a, javajs.util.P3 b)
      Look for true {1 0 0}, {0 1 0}, {0 0 1} difference.
      private static boolean loadData​(Viewer vwr, java.lang.Object me)  
      static void main​(java.lang.String[] args)  
      private void removeDuplicates​(javajs.util.BS bs)  
      private static int scanTo​(int i, java.lang.String num)  
      (package private) javajs.util.P3 toFractional​(Atom a, SymmetryInterface uc)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MAX_COUNT

        private static final int MAX_COUNT
        maximum allowable supercell
        See Also:
        Constant Field Values
      • SLOP0014

        private static final float SLOP0014
        maximum allowable distance fx, fy ,fz for atom finder
      • SLOP001

        private static final float SLOP001
        tolerance for fractional coord and
        See Also:
        Constant Field Values
      • SLOP0001

        private static final float SLOP0001
        tolerance for fractional coord and
        See Also:
        Constant Field Values
      • GROUP_COUNT

        private static int GROUP_COUNT
      • OP_COUNT

        private static int OP_COUNT
      • bsOpGroups

        private static javajs.util.BS[] bsOpGroups
      • bsGroupOps

        private static javajs.util.BS[] bsGroupOps
      • groupNames

        private static java.lang.String[] groupNames
      • opXYZ

        private static java.lang.String[] opXYZ
      • rdr

        private static java.io.BufferedReader rdr
      • nAtoms

        private int nAtoms
      • pt

        private javajs.util.P3 pt
    • Constructor Detail

      • SpaceGroupFinder

        public SpaceGroupFinder()
    • Method Detail

      • findSpaceGroup

        public java.lang.Object findSpaceGroup​(Viewer vwr,
                                               javajs.util.BS atoms0,
                                               java.lang.String xyzList,
                                               float[] unitCellParams,
                                               SymmetryInterface uc,
                                               boolean asString,
                                               boolean isAssign)
        Parameters:
        vwr -
        atoms0 -
        xyzList -
        unitCellParams -
        uc -
        asString -
        isAssign -
        Returns:
        SpaceGroup or null if isAssign, spacegroup information map if
      • removeDuplicates

        private void removeDuplicates​(javajs.util.BS bs)
      • dumpBasis

        private void dumpBasis​(javajs.util.BS ops,
                               javajs.util.BS bs1,
                               javajs.util.BS bsPoints)
      • checkBasis

        private boolean checkBasis​(javajs.util.BS uncheckedOps,
                                   javajs.util.BS bsPoints,
                                   javajs.util.BS targets)
      • filterGroups

        private void filterGroups​(javajs.util.BS bsGroups,
                                  float[] params)
        Remove possibilities based on unit cells. No attempt is made to permute axes. Rhombohedral groups are never included. orthorhombic = 16 - 74 (a, b, c, 90, 90, 90) tetragonal = 75 - 142 (a, a, c, 90, 90, 90) trigonal = 143 - 194 (a, a, c, 90, 90, 120) cubic = 195 - 230 (a, a, a, 90, 90, 90)
        Parameters:
        bsGroups -
        params -
      • scanTo

        private static int scanTo​(int i,
                                  java.lang.String num)
      • getGroupsWithOps

        private java.lang.Object getGroupsWithOps​(java.lang.String xyzList,
                                                  float[] unitCellParams,
                                                  boolean isAssign)
        Find all space groups that match EXACTLY or contain all of the operations specified. Operation need not be in Jmol-canonical form. For instance, "1-x,-y,-z" will be matched to "-x,-y,-z". Could be the result of spacegroup(nameOrXYZList, unitcellParametersArray) or MODELKIT ASSIGN SPACEGROUP "nameOrXYZList" other than P1
        Parameters:
        xyzList - a semicolon-separated list of possible space groups, such as "-x,-y,-z;x,-y,-z" or a space group ID such as "133:2"; if a list, prefixing or postfixing the list with "&" or joining with "&" indicates that a partial match is desired, returning a list of names of space groups that have at least the specified operations
        unitCellParams -
        isAssign - from ModelKit
        Returns:
        an array of space group IDs if not isAssign and not "="; a SpaceGroup or null if isAssign; a single space group ID as a string if "=" and a string starting and ending with "?" if an xyz operator is of an invalid form.
      • checkSupercell

        public SymmetryInterface checkSupercell​(Viewer vwr,
                                                SymmetryInterface uc,
                                                javajs.util.BS bsPoints,
                                                int abc,
                                                javajs.util.P3 scaling)
        Look for a supercell and adjust lattice down if necessary.
        Parameters:
        vwr -
        uc -
        bsPoints -
        abc - 1==a, 2==b, 3==c
        scaling - set to [na, nb, nc]
        Returns:
        revised unit cell
      • approx0

        private boolean approx0​(float f)
      • approx000

        private boolean approx000​(float f)
      • approx0014

        private boolean approx0014​(float f)
      • approxInt

        private int approxInt​(float finv)
      • findEquiv

        private int findEquiv​(int iop,
                              SymmetryOperation op,
                              int i,
                              javajs.util.BS bsPoints,
                              javajs.util.P3 pt,
                              boolean andClear)
      • latticeShift

        private boolean latticeShift​(javajs.util.P3 a,
                                     javajs.util.P3 b)
        Look for true {1 0 0}, {0 1 0}, {0 0 1} difference. This comes from issues with SimpleCell.unitize and our methods here, I think.
        Parameters:
        a -
        b -
        Returns:
        true if a lattice shift
      • main

        public static void main​(java.lang.String[] args)
      • loadData

        private static boolean loadData​(Viewer vwr,
                                        java.lang.Object me)
      • getList

        private static java.lang.String[] getList​(Viewer vwr,
                                                  java.lang.Object me,
                                                  java.lang.String[] list,
                                                  java.lang.String fileName)
                                           throws java.io.IOException
        Throws:
        java.io.IOException