Package org.jmol.adapter.readers.xtal
Class CrystalReader
- java.lang.Object
-
- org.jmol.adapter.smarter.AtomSetCollectionReader
-
- org.jmol.adapter.readers.xtal.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 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
Fields Modifier and Type Field Description private int
ac
private int[]
atomFrag
private int
atomIndexLast
private javajs.util.V3[]
directLatticeVectors
private java.lang.Double
energy
private boolean
getLastConventional
private boolean
haveCharges
private boolean
havePrimitiveMapping
private boolean
inputOnly
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 float
primitiveDensity
private javajs.util.M3
primitiveToCryst
private int[]
primitiveToIndex
private float
primitiveVolume
private javajs.util.P3
ptOriginShift
private java.lang.String
spaceGroupName
private javajs.util.Lst<java.lang.String>
vCoords
private javajs.util.Lst<java.lang.String>
vPrimitiveMapping
-
Fields inherited from class org.jmol.adapter.smarter.AtomSetCollectionReader
addedData, addedDataKey, addVibrations, allowPDBFilter, ANGSTROMS_PER_BOHR, applySymmetryToBonds, asc, baseAtomIndex, binaryDoc, bsFilter, bsModels, calculationType, continuing, debugging, desiredModelNumber, desiredSpaceGroupIndex, desiredVibrationNumber, doApplySymmetry, doCentralize, doCheckUnitCell, doConvertToFractional, doPackUnitCell, doProcessLines, doReadMolecularOrbitals, dssr, fileName, fileOffset, filePath, fileScaling, fillRange, filter, filterHetero, fixJavaFloat, forcePacked, getHeader, haveAtomFilter, haveModel, havePartialChargeFilter, htParams, ignoreFileSpaceGroupName, ignoreFileSymmetryOperators, ignoreFileUnitCell, ignoreStructure, iHaveFractionalCoordinates, iHaveSymmetryOperators, iHaveUnitCell, isBinary, isConcatenated, isDSSP1, isFinalized, isSequential, isTrajectory, latticeCells, latticeScaling, line, lstNCS, matUnitCellOrientation, modelNumber, ms, mustFinalizeModelSet, next, out, packingError, prevline, ptLine, ptSupercell, reader, readerName, reverseModels, sgName, stateScriptVersionInt, strSupercell, symmetry, templateAtomCount, thisBiomolecule, trajectorySteps, unitCellOffset, unitCellParams, useAltNames, useFileModelNumbers, validation, vibrationNumber, vibsFractional, vwr
-
-
Constructor Summary
Constructors Constructor Description CrystalReader()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
checkLine()
private void
createAtomsFromCoordLines()
Now create atoms from the coordinate lines.protected void
finalizeSubclassReader()
optional reader-specific method run first.private static java.lang.String
fixAtomName(java.lang.String s)
MN33 becomes Mn33private int
getAtomicNumber(java.lang.String token)
private int
getAtomIndexFromPrimitiveIndex(int iPrim)
private boolean
getQuadrupoleTensors()
protected void
initializeReader()
private void
newAtomSet()
private boolean
readAtoms()
private boolean
readBornChargeTensors()
private void
readCoordLines()
Read coordinates, either input or crystallographic, just saving their lines in a vector for now.private boolean
readData(java.lang.String name, int nfields)
For spin and magnetic moment data, read the data block and save it as property_spin or propert_magneticMoment.private boolean
readFreqFragments()
Select only specific atoms for frequency generation.private boolean
readFrequencies()
private boolean
readGradient()
Read minimization measuresprivate boolean
readHeader()
private void
readLatticeParams(boolean isNewSet)
Read the lattice parameters.private boolean
readPartialCharges()
private void
readPrimitiveMapping()
private boolean
readShift()
Read the origin shiftprivate boolean
readTotalAtomicCharges()
private void
readTransformationMatrix()
Read transform matrix primitive to conventional.private boolean
setDirect()
private void
setEnergy()
private void
setFreqValue(float freq, java.lang.String[] data)
private boolean
setPrimitiveMapping()
Create arrays that maps primitive atoms to conventional atoms in a 1:1 fashion.private void
setPrimitiveVolumeAndDensity()
Read the primitive cell volume and density.-
Methods inherited from class org.jmol.adapter.smarter.AtomSetCollectionReader
addAtomXYZSymName, addJmolScript, addPrimitiveLatticeVector, addSites, addSiteScript, appendLoadNote, appendUunitCellInfo, applySymmetryAndSetTrajectory, applySymTrajASCR, checkCurrentLineForScript, checkFilterKey, checkLastModel, checkLineForScript, clearUnitCell, cloneLastAtomSet, discardLinesUntilBlank, discardLinesUntilContains, discardLinesUntilContains2, discardLinesUntilNonBlank, discardLinesUntilStartsWith, discardPreviousAtoms, doGetModel, doGetVibration, doPreSymmetry, fillDataBlock, fillDataBlockFixed, fillFloatArray, fillFrequencyData, filterAtom, filterReject, finalizeMOData, finalizeModelSet, finalizeReaderASCR, finalizeSubclassSymmetry, forceSymmetry, fractionalizeCoordinates, getElementSymbol, getFilter, getFortranFormatLengths, getInterface, getNewSymmetry, getStrings, getSymmetry, getTokens, getTokensFloat, initializeSymmetry, initializeSymmetryOptions, initializeTrajectoryFile, isLastModel, newAtomSet, parseFloat, parseFloatRange, parseFloatStr, parseInt, parseIntAt, parseIntRange, parseIntStr, parseToken, parseTokenNext, parseTokenRange, parseTokenStr, processBinaryDocument, processDOM, rd, read3Vectors, readDataObject, readLines, readNextLine, rejectAtomName, RL, set2D, setAtomCoord, setAtomCoordScaled, setAtomCoordTokens, setAtomCoordXYZ, setChainID, setElementAndIsotope, setFilter, setFilterAtomTypeStr, setFractionalCoordinates, setIsPDB, setLoadNote, setModelPDB, setSpaceGroupName, setSymmetryOperator, setTransform, setUnitCell, setUnitCellItem, setup, setupASCR
-
-
-
-
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
-
inputOnly
private boolean inputOnly
-
isLongMode
private boolean isLongMode
-
getLastConventional
private boolean getLastConventional
-
havePrimitiveMapping
private boolean havePrimitiveMapping
-
isProperties
private boolean isProperties
-
ac
private int ac
-
atomIndexLast
private int atomIndexLast
-
atomFrag
private int[] atomFrag
-
primitiveToIndex
private int[] primitiveToIndex
-
nuclearCharges
private float[] nuclearCharges
-
vCoords
private javajs.util.Lst<java.lang.String> vCoords
-
energy
private java.lang.Double energy
-
ptOriginShift
private javajs.util.P3 ptOriginShift
-
primitiveToCryst
private javajs.util.M3 primitiveToCryst
-
directLatticeVectors
private javajs.util.V3[] directLatticeVectors
-
spaceGroupName
private java.lang.String spaceGroupName
-
primitiveVolume
private float primitiveVolume
-
primitiveDensity
private float primitiveDensity
-
vPrimitiveMapping
private javajs.util.Lst<java.lang.String> vPrimitiveMapping
-
-
Method Detail
-
initializeReader
protected void initializeReader() throws java.lang.Exception
- Overrides:
initializeReader
in classAtomSetCollectionReader
- Throws:
java.lang.Exception
-
checkLine
protected boolean checkLine() throws java.lang.Exception
- Overrides:
checkLine
in classAtomSetCollectionReader
- Returns:
- true if need to read new line
- Throws:
java.lang.Exception
-
finalizeSubclassReader
protected void finalizeSubclassReader() throws java.lang.Exception
Description copied from class:AtomSetCollectionReader
optional reader-specific method run first.- Overrides:
finalizeSubclassReader
in classAtomSetCollectionReader
- Throws:
java.lang.Exception
-
setDirect
private boolean setDirect() throws java.lang.Exception
- Throws:
java.lang.Exception
-
readTransformationMatrix
private void readTransformationMatrix() throws java.lang.Exception
Read transform matrix primitive to conventional.- Throws:
java.lang.Exception
-
readShift
private boolean readShift()
Read the origin shift- Returns:
- true
-
setPrimitiveVolumeAndDensity
private void setPrimitiveVolumeAndDensity()
Read the primitive cell volume and density. Not sure why we are rounding here.
-
readHeader
private boolean readHeader() throws java.lang.Exception
- Throws:
java.lang.Exception
-
readLatticeParams
private void readLatticeParams(boolean isNewSet) throws java.lang.Exception
Read the lattice parameters.- Parameters:
isNewSet
-- Throws:
java.lang.Exception
-
readPrimitiveMapping
private void readPrimitiveMapping() throws java.lang.Exception
- Throws:
java.lang.Exception
-
setPrimitiveMapping
private boolean setPrimitiveMapping() 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 if coordinates have been created
- Throws:
java.lang.Exception
-
readAtoms
private boolean readAtoms() throws java.lang.Exception
- Throws:
java.lang.Exception
-
fixAtomName
private static java.lang.String fixAtomName(java.lang.String s)
MN33 becomes Mn33- Parameters:
s
-- Returns:
- fixed atom name
-
getAtomicNumber
private int getAtomicNumber(java.lang.String token)
-
readCoordLines
private void readCoordLines() throws java.lang.Exception
Read coordinates, either input or crystallographic, just saving their lines in a vector for now.- Throws:
java.lang.Exception
-
createAtomsFromCoordLines
private void createAtomsFromCoordLines() throws java.lang.Exception
Now create atoms from the coordinate lines.- Throws:
java.lang.Exception
-
newAtomSet
private void newAtomSet() throws java.lang.Exception
- Throws:
java.lang.Exception
-
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)
-
readFreqFragments
private boolean readFreqFragments() throws java.lang.Exception
Select only specific atoms for frequency generation. (See freq_6for_001.out)- Returns:
- true
- 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)
-
readGradient
private boolean readGradient() throws java.lang.Exception
Read minimization measures- Returns:
- true
- Throws:
java.lang.Exception
-
readData
private boolean readData(java.lang.String name, int nfields) throws java.lang.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:
java.lang.Exception
-
getQuadrupoleTensors
private boolean getQuadrupoleTensors() throws java.lang.Exception
- Throws:
java.lang.Exception
-
readBornChargeTensors
private boolean readBornChargeTensors() throws java.lang.Exception
- Throws:
java.lang.Exception
-
-