Class CrystalReader

  • All Implemented Interfaces:
    javajs.api.GenericLineReader

    public class CrystalReader
    extends AtomSetCollectionReader
    A reader of OUT and OUTP files for CRYSTAL http://www.crystal.unito.it/
    Version:
    1.4 special model auxiliaryInfo include: primitiveToCrystal M3 transforming primitive lattice to conventional lattice mat4PrimitiveToCrystal M4 for use in transforming symmetry operations mat4CrystalToPrimitive M4 convenience inverse of mat4PrimitiveToCrystal fileSymmetryOperations List<String> symmetry operators (primitive) Drawing primitive unitcell operations: ops = _M.fileSystemOperations DRAW SYMOP @{ops[2]} If using the conventional cell, you can use its operators, or you can limit yourself this primitive subset using: mp2c = _M.mat4PrimitiveToCrystal mc2p = _M.mat4CrystalToPrimitive DRAW SYMOP @{mc2p * ops[2] * mp2c} for a specific model in the set, use load "xxx.out" n as for all readers, where n is an integer > 0 for final optimized geometry use load "xxx.out" 0 (that is, "read the last model") as for all readers for conventional unit cell -- input coordinates only, use load "xxx.out" filter "conventional" to NOT load vibrations, use load "xxx.out" FILTER "novibrations" to load just the input deck exactly as indicated, use load "xxx.out" FILTER "input" now allows reading of frequencies and atomic values with conventional as long as this is not an optimization.
    Author:
    Pieremanuele Canepa, Room 104, FM Group School of Physical Sciences, Ingram Building, University of Kent, Canterbury, Kent, CT2 7NH United Kingdom, pc229@kent.ac.uk, Bob Hanson hansonr@stolaf.edu
    • Field Detail

      • isVersion3

        private boolean isVersion3
      • isPolymer

        private boolean isPolymer
      • isSlab

        private boolean isSlab
      • haveCharges

        private boolean haveCharges
      • inputOnly

        private boolean inputOnly
      • isLongMode

        private boolean isLongMode
      • getLastConventional

        private boolean getLastConventional
      • havePrimitiveMapping

        private boolean havePrimitiveMapping
      • isProperties

        private boolean isProperties
      • state

        private int state
      • ac

        private int ac
      • atomIndexLast

        private int atomIndexLast
      • atomFrag

        private int[] atomFrag
      • primitiveToIndex

        private int[] primitiveToIndex
      • nuclearCharges

        private float[] nuclearCharges
      • lstCoords

        private javajs.util.Lst<String> lstCoords
      • energy

        private Double energy
      • ptOriginShift

        private javajs.util.P3 ptOriginShift
      • directLatticeVectors

        private javajs.util.V3[] directLatticeVectors
      • spaceGroupName

        private String spaceGroupName
      • checkModelTrigger

        private boolean checkModelTrigger
      • fullSymmetry

        private boolean fullSymmetry
      • htCriticalPoints

        private Map<String,​javajs.util.Lst<Object>> htCriticalPoints
      • directLatticeVectorsFirst

        private boolean directLatticeVectorsFirst
        CRYSTAL 17 moves directLatticeVectors before LATTICE PARAMETERS
      • cpno

        private int cpno
      • crtypes

        private static final String[] crtypes
      • symops

        private javajs.util.Lst<String> symops
      • f14

        private final float[] f14
      • f16

        private final float[] f16
      • smap

        private static final int[] smap
      • primitiveVolume

        private float primitiveVolume
      • primitiveDensity

        private float primitiveDensity
      • firstLine

        private String firstLine
    • Constructor Detail

      • CrystalReader

        public CrystalReader()
    • Method Detail

      • processNextCriticalPoint

        private void processNextCriticalPoint()
                                       throws Exception
        Throws:
        Exception
      • getCPAtomInfo

        private String getCPAtomInfo​(String line,
                                     javajs.util.Lst<Object> list)
        Process a CP data line
        Parameters:
        line - full TOPOND data line
        list - entries to fill with information
        Returns:
        matrix information for eigenvectors
      • newLattice

        private void newLattice​(boolean isConv)
                         throws Exception
        Throws:
        Exception
      • readSymmetryOperators

        private void readSymmetryOperators()
                                    throws Exception
        Throws:
        Exception
      • setUnitCellOrientation

        private void setUnitCellOrientation()
      • readPrimitiveLatticeVectors

        private void readPrimitiveLatticeVectors()
                                          throws Exception
        Read transform matrix primitive to conventional.
        Throws:
        Exception
      • readShift

        private boolean readShift()
        Read the origin shift
        Returns:
        true
      • readLatticeParams

        private void readLatticeParams​(boolean isPrimitive)
                                throws Exception
        Read the lattice parameters.
        Parameters:
        isPrimitive -
        Throws:
        Exception
      • getAtomIndexFromPrimitiveIndex

        private int getAtomIndexFromPrimitiveIndex​(int iPrim)
        Get the atom index from a primitive index. Used for atomic properties and frequency fragments. Note that primitive to conventional is not a 1:1 mapping. We don't consider that.
        Parameters:
        iPrim -
        Returns:
        the original number or the number from the primitive.
      • fixAtomName

        private static String fixAtomName​(String s)
        MN33 becomes Mn33
        Parameters:
        s -
        Returns:
        fixed atom name
      • getAtomicNumber

        private int getAtomicNumber​(String token)
      • readCoordLines

        private void readCoordLines()
                             throws Exception
        Read coordinates, either input or crystallographic, just saving their lines in a vector for now.
        Throws:
        Exception
      • processCoordLines

        private void processCoordLines()
                                throws Exception
        Now create atoms from the coordinate lines.
        Throws:
        Exception
      • setEnergy

        private void setEnergy()
      • readPartialCharges

        private boolean readPartialCharges()
                                    throws Exception
        Throws:
        Exception
      • readTotalAtomicCharges

        private boolean readTotalAtomicCharges()
                                        throws Exception
        Throws:
        Exception
      • readFreqFragments

        private void readFreqFragments()
                                throws Exception
        Select only specific atoms for frequency generation. (See freq_6for_001.out)
        Throws:
        Exception
      • setFreqValue

        private void setFreqValue​(float freq,
                                  String[] data)
      • getModelForMode

        private int getModelForMode​(int i0,
                                    int mode)
      • readGradient

        private boolean readGradient()
                              throws Exception
        Read minimization measures
        Returns:
        true
        Throws:
        Exception
      • readData

        private boolean readData​(String name,
                                 int nfields)
                          throws Exception
        For spin and magnetic moment data, read the data block and save it as property_spin or propert_magneticMoment.
        Parameters:
        name -
        nfields -
        Returns:
        true
        Throws:
        Exception
      • getQuadrupoleTensors

        private boolean getQuadrupoleTensors()
                                      throws Exception
        Throws:
        Exception
      • readBornChargeTensors

        private boolean readBornChargeTensors()
                                       throws Exception
        Throws:
        Exception