Package org.jmol.symmetry
Class SpaceGroupFinder
- java.lang.Object
-
- org.jmol.symmetry.SpaceGroupFinder
-
public class SpaceGroupFinder extends java.lang.ObjectA 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classSpaceGroupFinder.SGAtom
-
Field Summary
Fields Modifier and Type Field Description private SpaceGroupFinder.SGAtom[]atomsprivate static javajs.util.BS[]bsGroupOpsprivate static javajs.util.BS[]bsOpGroupsprivate static intGROUP_COUNTprivate static java.lang.String[]groupNamesprivate static intMAX_COUNTmaximum allowable supercellprivate intnAtomsprivate static intOP_COUNTprivate static SymmetryOperation[]opsprivate static java.lang.String[]opXYZprivate javajs.util.P3ptprivate static java.io.BufferedReaderrdrprivate static floatSLOP0001tolerance for fractional coord andprivate static floatSLOP001tolerance for fractional coord andprivate static floatSLOP0014maximum allowable distance fx, fy ,fz for atom finder
-
Constructor Summary
Constructors Constructor Description SpaceGroupFinder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleanapprox0(float f)private booleanapprox000(float f)private booleanapprox0014(float f)private intapproxInt(float finv)private booleancheckBasis(javajs.util.BS uncheckedOps, javajs.util.BS bsPoints, javajs.util.BS targets)SymmetryInterfacecheckSupercell(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 voiddumpBasis(javajs.util.BS ops, javajs.util.BS bs1, javajs.util.BS bsPoints)private voidfilterGroups(javajs.util.BS bsGroups, float[] params)Remove possibilities based on unit cells.private intfindEquiv(int iop, SymmetryOperation op, int i, javajs.util.BS bsPoints, javajs.util.P3 pt, boolean andClear)java.lang.ObjectfindSpaceGroup(Viewer vwr, javajs.util.BS atoms0, java.lang.String xyzList, float[] unitCellParams, SymmetryInterface uc, boolean asString, boolean isAssign)private java.lang.ObjectgetGroupsWithOps(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 SymmetryOperationgetOp(int iop)private booleanlatticeShift(javajs.util.P3 a, javajs.util.P3 b)Look for true {1 0 0}, {0 1 0}, {0 0 1} difference.private static booleanloadData(Viewer vwr, java.lang.Object me)static voidmain(java.lang.String[] args)private voidremoveDuplicates(javajs.util.BS bs)private static intscanTo(int i, java.lang.String num)(package private) javajs.util.P3toFractional(Atom a, SymmetryInterface uc)
-
-
-
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
-
ops
private static SymmetryOperation[] ops
-
rdr
private static java.io.BufferedReader rdr
-
atoms
private SpaceGroupFinder.SGAtom[] atoms
-
nAtoms
private int nAtoms
-
pt
private javajs.util.P3 pt
-
-
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 operationsunitCellParams-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.
-
toFractional
javajs.util.P3 toFractional(Atom a, SymmetryInterface uc)
-
getOp
private static SymmetryOperation getOp(int iop)
-
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==cscaling- 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
-
-