Package org.jmol.adapter.readers.xtal
Class CastepReader
java.lang.Object
org.jmol.adapter.smarter.AtomSetCollectionReader
org.jmol.adapter.readers.xtal.CastepReader
- All Implemented Interfaces:
javajs.api.GenericLineReader
CASTEP (http://www.castep.org) .cell file format relevant section of .cell
file are included as comments below
preliminary .castep, .phonon frequency reader
-- hansonr@stolaf.edu 9/2011
-- Many thanks to Keith Refson for his assistance with this implementation
-- atom's mass is encoded as bfactor
-- FILTER options include
"q=n" where n is an integer
"q={1/4 1/4 0}"
"q=ALL"
-- for non-simple fractions, you must use the exact form of the wavevector description:
-- load "xxx.phonon" FILTER "q=(-0.083333 0.083333 0.500000)
-- for simple fractions, you can also just specify SUPERCELL {a b c} where
the number of cells matches a given wavevector -- SUPERCELL {4 4 1}, for example
note: following was never implemented?
-- following this with ".1" ".2" etc. gives first, second, third, etc. occurance:
-- load "xxx.phonon" FILTER "q=1.3" ....
-- load "xxx.phonon" FILTER "{0 0 0}.3" ....
- Version:
- 1.2
- Author:
- Joerg Meyer, FHI Berlin 2009 (meyer@fhi-berlin.mpg.de)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate float
private javajs.util.V3[]
private int
private float
private javajs.util.P3[]
private float
private float
private float
private String
private String
private javajs.util.V3
private float
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private String
private static final float[]
private static final String[]
private javajs.util.M4
private int
private static final float
private String[]
private String
private static final double
Fields inherited from class org.jmol.adapter.smarter.AtomSetCollectionReader
addedData, addedDataKey, addVibrations, allow_a_len_1, allowPDBFilter, ANGSTROMS_PER_BOHR, applySymmetryToBonds, asc, baseAtomIndex, baseBondIndex, binaryDoc, bsFilter, bsModels, calculationType, CELL_TYPE_CONVENTIONAL, CELL_TYPE_PRIMITIVE, centroidPacked, continuing, debugging, desiredModelNumber, desiredSpaceGroupIndex, desiredVibrationNumber, doApplySymmetry, doCentralize, doCentroidUnitCell, doCheckUnitCell, doConvertToFractional, doPackUnitCell, doProcessLines, doReadMolecularOrbitals, dssr, fileName, fileOffset, filePath, fileScaling, fillRange, filter, filterAllHetero, filterCased, filterHetero, fixJavaFloat, forcePacked, getHeader, haveAtomFilter, haveModel, havePartialChargeFilter, htParams, ignoreFileSpaceGroupName, ignoreFileSymmetryOperators, ignoreFileUnitCell, ignoreStructure, iHaveFractionalCoordinates, iHaveSymmetryOperators, iHaveUnitCell, isBinary, isConcatenated, isDSSP1, isFinalized, isMolecular, isPrimitive, isSequential, isTrajectory, latticeCells, latticeScaling, latticeType, line, lstNCS, matUnitCellOrientation, merging, modDim, modelNumber, ms, mustFinalizeModelSet, next, noPack, out, packingError, paramsCentroid, paramsLattice, prevline, primitiveToCrystal, ptLine, ptSupercell, reader, readerName, requiresBSFilter, reverseModels, rotateHexCell, sgName, slabXY, stateScriptVersionInt, strSupercell, symmetry, templateAtomCount, thisBiomolecule, trajectorySteps, ucItems, unitCellOffset, unitCellParams, useAltNames, useFileModelNumbers, validation, vibrationNumber, vibsFractional, vwr
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
protected void
optional reader-specific method run first.private String
getFractionalCoord
(javajs.util.V3 qvec) private void
void
private static boolean
isInt
(float f) private void
readAtomData
(float factor) private void
readEnergy
(int pt, String prefix) private boolean
private void
private void
private float
readLengthUnit
(String units) private int
private void
private void
private void
read Mulliken or Hirshfield chargesprivate void
private void
private void
private void
private void
private void
private void
private void
private void
private void
setPhononVector
(float[] data, Atom atom, javajs.util.V3 rTrans, javajs.util.V3 qvec, javajs.util.V3 v) transform complex vibration vector to a real vector by applying the appropriate translation, storing the results in vprivate int
Methods inherited from class org.jmol.adapter.smarter.AtomSetCollectionReader
addAtomXYZSymName, addExplicitLatticeVector, addJmolScript, addSites, addSiteScript, appendLoadNote, appendUunitCellInfo, applySymmetryAndSetTrajectory, applySymTrajASCR, checkAndRemoveFilterKey, checkCurrentLineForScript, checkFilterKey, checkLastModel, checkLineForScript, clearUnitCell, cloneLastAtomSet, discardLinesUntilBlank, discardLinesUntilContains, discardLinesUntilContains2, discardLinesUntilNonBlank, discardLinesUntilStartsWith, discardPreviousAtoms, doGetModel, doGetVibration, doPreSymmetry, fill3x3, fillDataBlock, fillDataBlockFixed, fillFloatArray, fillFrequencyData, filterAtom, filterReject, finalizeMOData, finalizeModelSet, finalizeReaderASCR, finalizeSubclassSymmetry, forceSymmetry, fractionalizeCoordinates, getElementSymbol, getFilter, getFilterWithCase, 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 Details
-
RAD_TO_DEG
private static final float RAD_TO_DEG- See Also:
-
tokens
-
isPhonon
private boolean isPhonon -
isTS
private boolean isTS -
isOutput
private boolean isOutput -
isCell
private boolean isCell -
a
private float a -
b
private float b -
c
private float c -
alpha
private float alpha -
beta
private float beta -
gamma
private float gamma -
abc
private javajs.util.V3[] abc -
ac
private int ac -
atomPts
private javajs.util.P3[] atomPts -
havePhonons
private boolean havePhonons -
lastQPt
-
qpt2
private int qpt2 -
desiredQpt
private javajs.util.V3 desiredQpt -
desiredQ
-
chargeType
-
isAllQ
private boolean isAllQ -
haveCharges
private boolean haveCharges -
tsType
-
lengthUnitIds
-
lengthUnitFactors
private static final float[] lengthUnitFactors -
matSupercell
private javajs.util.M4 matSupercell -
TWOPI
private static final double TWOPI- See Also:
-
-
Constructor Details
-
CastepReader
public CastepReader()
-
-
Method Details
-
initializeReader
- Overrides:
initializeReader
in classAtomSetCollectionReader
- Throws:
Exception
-
setDesiredQpt
-
readFileData
- Throws:
Exception
-
checkLine
- Overrides:
checkLine
in classAtomSetCollectionReader
- Returns:
- true if need to read new line
- Throws:
Exception
-
readOutputUnitCell
- Throws:
Exception
-
readOutputAtoms
- Throws:
Exception
-
readEnergy
- Throws:
Exception
-
readPhononTrajectories
- Throws:
Exception
-
finalizeSubclassReader
Description copied from class:AtomSetCollectionReader
optional reader-specific method run first.- Overrides:
finalizeSubclassReader
in classAtomSetCollectionReader
- Throws:
Exception
-
setLatticeVectors
private void setLatticeVectors() -
readLatticeAbc
- Throws:
Exception
-
readLatticeCart
- Throws:
Exception
-
readPositionsFrac
- Throws:
Exception
-
readPositionsAbs
- Throws:
Exception
-
readLengthUnit
- Throws:
Exception
-
readAtomData
- Throws:
Exception
-
tokenizeCastepCell
- Throws:
Exception
-
readOutputBornChargeTensors
- Throws:
Exception
-
readOutputAtomIndex
private int readOutputAtomIndex() -
getTensor
- Throws:
Exception
-
readOutputCharges
read Mulliken or Hirshfield charges- Throws:
Exception
-
readPhononUnitCell
- Throws:
Exception
-
readPhononFractionalCoord
- Throws:
Exception
-
readPhononFrequencies
- Throws:
Exception
-
getFractionalCoord
-
isInt
private static boolean isInt(float f) -
setPhononVector
private void setPhononVector(float[] data, Atom atom, javajs.util.V3 rTrans, javajs.util.V3 qvec, javajs.util.V3 v) transform complex vibration vector to a real vector by applying the appropriate translation, storing the results in v- Parameters:
data
- from .phonon line parsed for floatsatom
-rTrans
- translation vector in unit fractional coordqvec
- q point vectorv
- return vector
-