XtalSymmetry
Date: 2019-10-22

org.jmol.adapter.smarter

## Class XtalSymmetry

- java.lang.Object
- - org.jmol.adapter.smarter.XtalSymmetry

-     public class XtalSymmetry
      extends java.lang.Object

  A class used by AtomSetCollection for building the symmetry of a model and generating new atoms based on that symmetry.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private AtomSetCollectionReader` | `acr`
    `private boolean` | `applySymmetryToBonds`
    `private AtomSetCollection` | `asc`
    `private SymmetryInterface` | `baseSymmetry`
    `private float[]` | `baseUnitCell`
    `private int` | `bondCount0`
    `private boolean` | `centroidPacked`
    `private boolean` | `checkAll`
    `private boolean` | `doCentroidUnitCell`
    `private boolean` | `doNormalize`
    `private boolean` | `doPackUnitCell`
    `private int` | `dtype`
    `private java.lang.String` | `filterSymop`
    `private int` | `firstAtom`
    `private int[]` | `latticeCells`
    `private boolean` | `latticeOnly`
    `private int` | `latticeOp`
    `private javajs.util.P3i` | `maxXYZ`
    `private javajs.util.P3` | `maxXYZ0`
    `private javajs.util.P3i` | `minXYZ`
    `private javajs.util.P3` | `minXYZ0`
    `private javajs.util.M3` | `mTemp`
    `private int` | `noSymmetryCount`
    `private int` | `nVib`
    `private float` | `packingError`
    `private static int` | `PARTICLE_CHAIN`
    `private static int` | `PARTICLE_NONE`
    `private static int` | `PARTICLE_SYMOP`
    `private javajs.util.P3` | `ptOffset`
    `private javajs.util.P3` | `ptTemp`
    `private float` | `rmaxx` range minima and maxima -- also usedf for cartesians comparisons
    `private float` | `rmaxy` range minima and maxima -- also usedf for cartesians comparisons
    `private float` | `rmaxz` range minima and maxima -- also usedf for cartesians comparisons
    `private float` | `rminx` range minima and maxima -- also usedf for cartesians comparisons
    `private float` | `rminy` range minima and maxima -- also usedf for cartesians comparisons
    `private float` | `rminz` range minima and maxima -- also usedf for cartesians comparisons
    `private SymmetryInterface` | `sym2`
    `SymmetryInterface` | `symmetry`
    `private float` | `symmetryRange`
    `private javajs.util.Lst<float[]>` | `trajectoryUnitCells`
    `private float[]` | `unitCellParams`
    `private javajs.util.V3[]` | `unitCellTranslations`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XtalSymmetry()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Tensor` | `addRotatedTensor(Atom a, Tensor t, int iSym, boolean reset, SymmetryInterface symmetry)`
    `(package private) int` | `addSpaceGroupOperation(java.lang.String xyz, boolean andSetLattice)`
    `private void` | `adjustRangeMinMax(javajs.util.T3[] oabc)`
    `private void` | `applyAllSymmetry(MSInterface ms, javajs.util.BS bsAtoms)`
    `void` | `applySymmetryBio(java.util.Map<java.lang.String,java.lang.Object> thisBiomolecule, boolean applySymmetryToBonds, java.lang.String filter)`
    `(package private) SymmetryInterface` | `applySymmetryFromReader(SymmetryInterface readerSymmetry)`
    `private void` | `applySymmetryLattice()`
    `private void` | `duplicateAtomProperties(int nTimes)`
    `private void` | `finalizeSymmetry(SymmetryInterface symmetry)`
    `void` | `finalizeUnitCell(javajs.util.P3 ptSupercell)` Ensure that ModelLoader sets up the supercell unit cell.
    `SymmetryInterface` | `getBaseSymmetry()` Get the symmetry that was in place prior to any supercell business
    `javajs.util.T3` | `getOverallSpan()`
    `(package private) SymmetryInterface` | `getSymmetry()`
    `boolean` | `isWithinCell(int dtype, javajs.util.P3 pt, float minX, float maxX, float minY, float maxY, float minZ, float maxZ, float slop)`
    `private void` | `reset()`
    `void` | `scaleFractionalVibs()` magCIF files have moments expressed as Bohr magnetons along the cryrstallographic axes.
    `XtalSymmetry` | `set(AtomSetCollectionReader reader)`
    `private void` | `setAtomSetSpaceGroupName(java.lang.String spaceGroupName)`
    `private void` | `setLatticeCells()`
    `void` | `setLatticeParameter(int latt)`
    `void` | `setSpaceGroupFrom(SymmetryInterface readerSymmetry)`
    `int` | `setSpinVectors()`
    `(package private) SymmetryInterface` | `setSymmetry(SymmetryInterface symmetry)`
    `private void` | `setSymmetryMinMax(javajs.util.P3 c)`
    `private void` | `setSymmetryOps()`
    `private void` | `setSymmetryRange(float factor)`
    `(package private) void` | `setTensors()`
    `void` | `setTimeReversal(int op, int timeRev)`
    `private void` | `setUnitCell(float[] info, javajs.util.M3 matUnitCellOrientation, javajs.util.P3 unitCellOffset)`
    `private int` | `symmetryAddAtoms(int transX, int transY, int transZ, int baseCount, int pt, int iCellOpPt, javajs.util.P3[] cartesians, MSInterface ms, javajs.util.BS excludedOps, int[] atomMap)`
    `private javajs.util.BS` | `updateBSAtoms()` Update asc.bsAtoms to include all atoms, or at least all atoms that are still viable from the reader.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### asc

          private AtomSetCollection asc

    - #### acr

          private AtomSetCollectionReader acr

    - #### symmetry

          public SymmetryInterface symmetry

    - #### unitCellParams

          private float[] unitCellParams

    - #### baseUnitCell

          private float[] baseUnitCell

    - #### symmetryRange

          private float symmetryRange

    - #### doCentroidUnitCell

          private boolean doCentroidUnitCell

    - #### centroidPacked

          private boolean centroidPacked

    - #### packingError

          private float packingError

    - #### filterSymop

          private java.lang.String filterSymop

    - #### applySymmetryToBonds

          private boolean applySymmetryToBonds

    - #### latticeCells

          private int[] latticeCells

    - #### trajectoryUnitCells

          private javajs.util.Lst<float[]> trajectoryUnitCells

    - #### doNormalize

          private boolean doNormalize

    - #### doPackUnitCell

          private boolean doPackUnitCell

    - #### baseSymmetry

          private SymmetryInterface baseSymmetry

    - #### sym2

          private SymmetryInterface sym2

    - #### rminx

          private float rminx

      range minima and maxima -- also usedf for cartesians comparisons

    - #### rminy

          private float rminy

      range minima and maxima -- also usedf for cartesians comparisons

    - #### rminz

          private float rminz

      range minima and maxima -- also usedf for cartesians comparisons

    - #### rmaxx

          private float rmaxx

      range minima and maxima -- also usedf for cartesians comparisons

    - #### rmaxy

          private float rmaxy

      range minima and maxima -- also usedf for cartesians comparisons

    - #### rmaxz

          private float rmaxz

      range minima and maxima -- also usedf for cartesians comparisons

    - #### ptOffset

          private final javajs.util.P3 ptOffset

    - #### minXYZ

          private javajs.util.P3i minXYZ

    - #### maxXYZ

          private javajs.util.P3i maxXYZ

    - #### minXYZ0

          private javajs.util.P3 minXYZ0

    - #### maxXYZ0

          private javajs.util.P3 maxXYZ0

    - #### checkAll

          private boolean checkAll

    - #### bondCount0

          private int bondCount0

    - #### dtype

          private int dtype

    - #### unitCellTranslations

          private javajs.util.V3[] unitCellTranslations

    - #### latticeOp

          private int latticeOp

    - #### latticeOnly

          private boolean latticeOnly

    - #### noSymmetryCount

          private int noSymmetryCount

    - #### firstAtom

          private int firstAtom

    - #### PARTICLE_NONE

          private static final int PARTICLE_NONE

      See Also:
        Constant Field Values

    - #### PARTICLE_CHAIN

          private static final int PARTICLE_CHAIN

      See Also:
        Constant Field Values

    - #### PARTICLE_SYMOP

          private static final int PARTICLE_SYMOP

      See Also:
        Constant Field Values

    - #### ptTemp

          private javajs.util.P3 ptTemp

    - #### mTemp

          private javajs.util.M3 mTemp

    - #### nVib

          private int nVib

  - ### Constructor Detail

    - #### XtalSymmetry

          public XtalSymmetry()

  - ### Method Detail

    - #### set

          public XtalSymmetry set(AtomSetCollectionReader reader)

    - #### getSymmetry

          SymmetryInterface getSymmetry()

    - #### setSymmetry

          SymmetryInterface setSymmetry(SymmetryInterface symmetry)

    - #### setSymmetryRange

          private void setSymmetryRange(float factor)

    - #### setLatticeCells

          private void setLatticeCells()

    - #### setUnitCell

          private void setUnitCell(float[] info,
                                   javajs.util.M3 matUnitCellOrientation,
                                   javajs.util.P3 unitCellOffset)

    - #### addSpaceGroupOperation

          int addSpaceGroupOperation(java.lang.String xyz,
                                     boolean andSetLattice)

    - #### setLatticeParameter

          public void setLatticeParameter(int latt)

    - #### applySymmetryFromReader

          SymmetryInterface applySymmetryFromReader(SymmetryInterface readerSymmetry)
                                             throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### setSpaceGroupFrom

          public void setSpaceGroupFrom(SymmetryInterface readerSymmetry)

    - #### setAtomSetSpaceGroupName

          private void setAtomSetSpaceGroupName(java.lang.String spaceGroupName)

    - #### applySymmetryLattice

          private void applySymmetryLattice()
                                     throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### updateBSAtoms

          private javajs.util.BS updateBSAtoms()

      Update asc.bsAtoms to include all atoms, or at least all atoms that are still viable from the reader.
      Returns:
        updated BS

    - #### adjustRangeMinMax

          private void adjustRangeMinMax(javajs.util.T3[] oabc)

    - #### setSymmetryMinMax

          private void setSymmetryMinMax(javajs.util.P3 c)

    - #### isWithinCell

          public boolean isWithinCell(int dtype,
                                      javajs.util.P3 pt,
                                      float minX,
                                      float maxX,
                                      float minY,
                                      float maxY,
                                      float minZ,
                                      float maxZ,
                                      float slop)

    - #### applyAllSymmetry

          private void applyAllSymmetry(MSInterface ms,
                                        javajs.util.BS bsAtoms)
                                 throws java.lang.Exception

      Parameters:
        `ms` - modulated structure interface
        `bsAtoms` - relating to supercells
      Throws:
        `java.lang.Exception`

    - #### symmetryAddAtoms

          private int symmetryAddAtoms(int transX,
                                       int transY,
                                       int transZ,
                                       int baseCount,
                                       int pt,
                                       int iCellOpPt,
                                       javajs.util.P3[] cartesians,
                                       MSInterface ms,
                                       javajs.util.BS excludedOps,
                                       int[] atomMap)
                                throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### duplicateAtomProperties

          private void duplicateAtomProperties(int nTimes)

    - #### finalizeSymmetry

          private void finalizeSymmetry(SymmetryInterface symmetry)

    - #### setSymmetryOps

          private void setSymmetryOps()

    - #### getOverallSpan

          public javajs.util.T3 getOverallSpan()

    - #### applySymmetryBio

          public void applySymmetryBio(java.util.Map<java.lang.String,java.lang.Object> thisBiomolecule,
                                       boolean applySymmetryToBonds,
                                       java.lang.String filter)

    - #### reset

          private void reset()

    - #### addRotatedTensor

          public Tensor addRotatedTensor(Atom a,
                                         Tensor t,
                                         int iSym,
                                         boolean reset,
                                         SymmetryInterface symmetry)

    - #### setTensors

          void setTensors()

    - #### setTimeReversal

          public void setTimeReversal(int op,
                                      int timeRev)

    - #### setSpinVectors

          public int setSpinVectors()

    - #### scaleFractionalVibs

          public void scaleFractionalVibs()

      magCIF files have moments expressed as Bohr magnetons along the cryrstallographic axes. These have to be "fractionalized" in order to be properly handled by symmetry operations, then, in the end, turned into Cartesians. It is not clear to me at all how this would be handled if there are subsystems. This method must be run PRIOR to applying symmetry and thus prior to creation of modulation sets.

    - #### getBaseSymmetry

          public SymmetryInterface getBaseSymmetry()

      Get the symmetry that was in place prior to any supercell business
      Returns:
        base symmetry

    - #### finalizeUnitCell

          public void finalizeUnitCell(javajs.util.P3 ptSupercell)

      Ensure that ModelLoader sets up the supercell unit cell.
      Parameters:
        `ptSupercell` -