org.jmol.adapter.readers.xtal
Class CastepReader
java.lang.Object
org.jmol.adapter.smarter.AtomSetCollectionReader
org.jmol.adapter.readers.xtal.CastepReader
public class CastepReader
- extends AtomSetCollectionReader
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 or "q={1/4 1/4 0}" -- 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 -- 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)
| 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 |
| 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 |
tokens
private String[] tokens
isPhonon
private boolean isPhonon
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 Vector3f[] abc
atomCount
private int atomCount
atomPts
private Point3f[] atomPts
havePhonons
private boolean havePhonons
lastQPt
private String lastQPt
qpt2
private int qpt2
desiredQpt
private Vector3f desiredQpt
desiredQ
private String desiredQ
lengthUnitIds
private static final String[] lengthUnitIds
lengthUnitFactors
private static final float[] lengthUnitFactors
TWOPI
private static final double TWOPI
- See Also:
- Constant Field Values
CastepReader
public CastepReader()
initializeReader
public void initializeReader()
throws Exception
- Overrides:
initializeReader in class AtomSetCollectionReader
- Throws:
Exception
setDesiredQpt
private void setDesiredQpt(String s)
readFileData
private boolean readFileData()
throws Exception
- Throws:
Exception
checkLine
protected boolean checkLine()
throws Exception
- Overrides:
checkLine in class AtomSetCollectionReader
- Returns:
- true if need to read new line
- Throws:
Exception
readOutputUnitCell
private void readOutputUnitCell()
throws Exception
- Throws:
Exception
readOutputAtoms
private void readOutputAtoms()
throws Exception
- Throws:
Exception
readOutputCharges
private void readOutputCharges()
throws Exception
- Throws:
Exception
readPhononTrajectories
private void readPhononTrajectories()
throws Exception
- Throws:
Exception
finalizeReader
protected void finalizeReader()
throws Exception
- Overrides:
finalizeReader in class AtomSetCollectionReader
- Throws:
Exception
setLatticeVectors
private void setLatticeVectors()
readLatticeAbc
private void readLatticeAbc()
throws Exception
- Throws:
Exception
readLatticeCart
private void readLatticeCart()
throws Exception
- Throws:
Exception
readPositionsFrac
private void readPositionsFrac()
throws Exception
- Throws:
Exception
readPositionsAbs
private void readPositionsAbs()
throws Exception
- Throws:
Exception
readLengthUnit
private float readLengthUnit(String units)
throws Exception
- Throws:
Exception
readAtomData
private void readAtomData(float factor)
throws Exception
- Throws:
Exception
tokenizeCastepCell
private int tokenizeCastepCell()
throws Exception
- Throws:
Exception
readPhononUnitCell
private void readPhononUnitCell()
throws Exception
- Throws:
Exception
readPhononFractionalCoord
private void readPhononFractionalCoord()
throws Exception
- Throws:
Exception
readPhononFrequencies
private void readPhononFrequencies()
throws Exception
- Throws:
Exception
getFractionalCoord
private String getFractionalCoord(Vector3f qvec)
isInt
private static boolean isInt(float f)
setPhononVector
private void setPhononVector(float[] data,
Atom atom,
Vector3f rTrans,
Vector3f qvec,
Vector3f 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