org.jmol.adapter.readers.xtal
Class CrystalReader

java.lang.Object
  extended by org.jmol.adapter.smarter.AtomSetCollectionReader
      extended by org.jmol.adapter.readers.xtal.CrystalReader

public class CrystalReader
extends AtomSetCollectionReader

A reader of OUT and OUTP files for CRYSTAL http://www.crystal.unito.it/

Version:
1.4 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

Field Summary
private  int atomCount
           
private  int[] atomFrag
           
private  int atomIndexLast
           
private  javax.vecmath.Vector3f[] directLatticeVectors
           
private  java.lang.Double energy
           
private  boolean getLastConventional
           
private  boolean haveCharges
           
private  boolean havePrimitiveMapping
           
private  boolean inputOnly
           
private  boolean isFreqCalc
           
private  boolean isLongMode
           
private  boolean isMolecular
           
private  boolean isPolymer
           
private  boolean isPrimitive
           
private  boolean isProperties
           
private  boolean isSlab
           
private  boolean isVersion3
           
private  float[] nuclearCharges
           
private  javax.vecmath.Matrix3f primitiveToCryst
           
private  int[] primitiveToIndex
           
private  javax.vecmath.Point3f ptOriginShift
           
private  java.lang.String spaceGroupName
           
private  java.util.List<java.lang.String> vInputCoords
           
 
Fields inherited from class org.jmol.adapter.smarter.AtomSetCollectionReader
addVibrations, ANGSTROMS_PER_BOHR, applySymmetryToBonds, atomSetCollection, bsFilter, bsModels, calculationType, continuing, desiredModelNumber, desiredVibrationNumber, doApplySymmetry, doc, doCheckUnitCell, doPackUnitCell, doProcessLines, filter, filterHetero, getHeader, haveModel, havePartialChargeFilter, htParams, ignoreFileSpaceGroupName, ignoreFileSymmetryOperators, ignoreFileUnitCell, iHaveFractionalCoordinates, iHaveSymmetryOperators, iHaveUnitCell, isBinary, isSequential, isTrajectory, latticeCells, line, matUnitCellOrientation, modelNumber, next, notionalUnitCell, os, prevline, ptLine, reader, readerName, readMolecularOrbitals, spaceGroup, stateScriptVersionInt, supercell, symmetry, templateAtomCount, useAltNames, vibrationNumber, viewer
 
Constructor Summary
CrystalReader()
           
 
Method Summary
protected  boolean checkLine()
           
protected  void finalizeReader()
           
private  float fraction(java.lang.String f)
           
private  int getAtomicNumber(java.lang.String token)
           
private  int getAtomIndexFromPrimitiveIndex(int iPrim)
           
private  java.lang.String getAtomName(java.lang.String s)
           
private  boolean getPropertyTensors()
           
protected  void initializeReader()
           
private  void newAtomSet()
           
private  void processInputCoords()
           
private  boolean readAtoms()
           
private  void readCellParams(boolean isNewSet)
           
private  void readCrystallographicCoords()
           
private  void readEnergy()
           
private  boolean readFragments()
           
private  boolean readFrequencies()
           
private  boolean readGradient()
           
private  boolean readHeader()
           
private  boolean readMagneticMoments()
           
private  boolean readPartialCharges()
           
private  boolean readPrimitiveMapping()
          create arrays that maps primitive atoms to conventional atoms in a 1:1 fashion.
private  boolean readShift()
           
private  boolean readSpins()
           
private  boolean readTotalAtomicCharges()
           
private  void readTransformationMatrix()
           
private  boolean readVolumePrimCell()
           
private  void setData(java.lang.String name, java.lang.String data, int pt, int dp)
           
private  boolean setDirect()
           
private  void setEnergy()
           
private  void setFreqValue(float freq, java.lang.String[] data)
           
 
Methods inherited from class org.jmol.adapter.smarter.AtomSetCollectionReader
addJmolScript, addPrimitiveLatticeVector, addSites, addSiteScript, appendLoadNote, applySymmetryAndSetTrajectory, checkFilter, checkLastModel, checkLineForScript, checkLineForScript, clearUnitCell, cloneLastAtomSet, discardLinesUntilBlank, discardLinesUntilContains, discardLinesUntilContains, discardLinesUntilNonBlank, discardLinesUntilStartsWith, doGetModel, doGetVibration, fillDataBlock, fillDataBlock, fillFloatArray, fillFrequencyData, filterAtom, getElementSymbol, getFortranFormatLengths, getStrings, getSymmetry, getTokens, getTokens, getTokens, getTokensFloat, initializeSymmetry, isLastModel, newAtomSet, parseFloat, parseFloat, parseFloat, parseInt, parseInt, parseInt, parseInt, parseStringInfestedFloatArray, parseToken, parseToken, parseToken, parseTokenNext, parseTrimmed, parseTrimmed, processBinaryDocument, processXml, read3Vectors, readData, readLine, readLines, set2D, setAtomCoord, setAtomCoord, setFilter, setFractionalCoordinates, setIsPDB, setMOData, setPdb, setSpaceGroupName, setSymmetryOperator, setTransform, setUnitCell, setUnitCellItem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isVersion3

private boolean isVersion3

isPrimitive

private boolean isPrimitive

isPolymer

private boolean isPolymer

isSlab

private boolean isSlab

isMolecular

private boolean isMolecular

haveCharges

private boolean haveCharges

isFreqCalc

private boolean isFreqCalc

inputOnly

private boolean inputOnly

isLongMode

private boolean isLongMode

getLastConventional

private boolean getLastConventional

havePrimitiveMapping

private boolean havePrimitiveMapping

isProperties

private boolean isProperties

atomCount

private int atomCount

atomIndexLast

private int atomIndexLast

atomFrag

private int[] atomFrag

primitiveToIndex

private int[] primitiveToIndex

nuclearCharges

private float[] nuclearCharges

vInputCoords

private java.util.List<java.lang.String> vInputCoords

energy

private java.lang.Double energy

ptOriginShift

private javax.vecmath.Point3f ptOriginShift

primitiveToCryst

private javax.vecmath.Matrix3f primitiveToCryst

directLatticeVectors

private javax.vecmath.Vector3f[] directLatticeVectors

spaceGroupName

private java.lang.String spaceGroupName
Constructor Detail

CrystalReader

public CrystalReader()
Method Detail

initializeReader

protected void initializeReader()
                         throws java.lang.Exception
Overrides:
initializeReader in class AtomSetCollectionReader
Throws:
java.lang.Exception

checkLine

protected boolean checkLine()
                     throws java.lang.Exception
Overrides:
checkLine in class AtomSetCollectionReader
Returns:
true if need to read new line
Throws:
java.lang.Exception

finalizeReader

protected void finalizeReader()
                       throws java.lang.Exception
Overrides:
finalizeReader in class AtomSetCollectionReader
Throws:
java.lang.Exception

setDirect

private boolean setDirect()
                   throws java.lang.Exception
Throws:
java.lang.Exception

readTransformationMatrix

private void readTransformationMatrix()
                               throws java.lang.Exception
Throws:
java.lang.Exception

readShift

private boolean readShift()

fraction

private float fraction(java.lang.String f)

readGradient

private boolean readGradient()
                      throws java.lang.Exception
Throws:
java.lang.Exception

readVolumePrimCell

private boolean readVolumePrimCell()

readSpins

private boolean readSpins()
                   throws java.lang.Exception
Throws:
java.lang.Exception

readMagneticMoments

private boolean readMagneticMoments()
                             throws java.lang.Exception
Throws:
java.lang.Exception

setData

private void setData(java.lang.String name,
                     java.lang.String data,
                     int pt,
                     int dp)
              throws java.lang.Exception
Throws:
java.lang.Exception

readHeader

private boolean readHeader()
                    throws java.lang.Exception
Throws:
java.lang.Exception

readCellParams

private void readCellParams(boolean isNewSet)
                     throws java.lang.Exception
Throws:
java.lang.Exception

readPrimitiveMapping

private boolean readPrimitiveMapping()
                              throws java.lang.Exception
create arrays that maps primitive atoms to conventional atoms in a 1:1 fashion. Creates: int[] primitiveToIndex -- points to model-based atomIndex

Returns:
TRUE
Throws:
java.lang.Exception

readAtoms

private boolean readAtoms()
                   throws java.lang.Exception
Throws:
java.lang.Exception

getAtomName

private java.lang.String getAtomName(java.lang.String s)

getAtomicNumber

private int getAtomicNumber(java.lang.String token)

readCrystallographicCoords

private void readCrystallographicCoords()
                                 throws java.lang.Exception
Throws:
java.lang.Exception

processInputCoords

private void processInputCoords()
                         throws java.lang.Exception
Throws:
java.lang.Exception

newAtomSet

private void newAtomSet()
                 throws java.lang.Exception
Throws:
java.lang.Exception

readEnergy

private void readEnergy()

setEnergy

private void setEnergy()

readPartialCharges

private boolean readPartialCharges()
                            throws java.lang.Exception
Throws:
java.lang.Exception

readTotalAtomicCharges

private boolean readTotalAtomicCharges()
                                throws java.lang.Exception
Throws:
java.lang.Exception

getAtomIndexFromPrimitiveIndex

private int getAtomIndexFromPrimitiveIndex(int iPrim)

readFragments

private boolean readFragments()
                       throws java.lang.Exception
Throws:
java.lang.Exception

readFrequencies

private boolean readFrequencies()
                         throws java.lang.Exception
Throws:
java.lang.Exception

setFreqValue

private void setFreqValue(float freq,
                          java.lang.String[] data)

getPropertyTensors

private boolean getPropertyTensors()
                            throws java.lang.Exception
Throws:
java.lang.Exception