Package org.jmol.adapter.readers.xtal
Class PWmatReader
- java.lang.Object
-
- org.jmol.adapter.smarter.AtomSetCollectionReader
-
- org.jmol.adapter.readers.xtal.PWmatReader
-
- All Implemented Interfaces:
javajs.api.GenericLineReader
public class PWmatReader extends AtomSetCollectionReader
crude PWmat atom.config reader http://pwmatus.com/manual- Author:
- hansonr
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringglobal3private booleanhaveLatticeprivate booleanhaveMagneticprivate booleanhavePositionsprivate intnAtomsThe format of pwmat config file specification is now clear, would like to adjust PWmatReader accordingly.-
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 Constructor Description PWmatReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplySymmetryAndSetTrajectory()protected booleancheckLine()protected voidfinalizeSubclassReader()optional reader-specific method run first.private java.lang.StringgetLine()protected voidinitializeReader()private voidreadComments()private voidreadCoordinates()private booleanreadDataBlock(java.lang.String name)private voidreadItems(java.lang.String name, int offset, float[] values)private voidreadUnitCell()private voidreadVectors(java.lang.String name, int offset, boolean haveLine)private java.lang.StringremoveComments()private voidsetProperties(java.lang.String name, float[] values, int n)private voidsetVectors(java.lang.String name, float[] valuesX, float[] valuesY, float[] valuesZ, int n)private java.lang.StringtrimPWPropertyNameTo(java.lang.String name, java.lang.String chars)-
Methods inherited from class org.jmol.adapter.smarter.AtomSetCollectionReader
addAtomXYZSymName, addExplicitLatticeVector, addJmolScript, addSites, addSiteScript, appendLoadNote, appendUunitCellInfo, 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 Detail
-
nAtoms
private int nAtoms
The format of pwmat config file specification is now clear, would like to adjust PWmatReader accordingly. The pwmat config file format accommodates conversion from other vendors and their formats. The first line always has number of atoms, before the number, could be spaces. after the number, there could be comments such as "generated from pwmat". Please ignore those comments, only gets the number from the first line. After the first line, there could be comments please ignore till reading of letter lattice or lattice vector. The letters are case non-sensitive. The lattice section consists of 3 lines representing lattice vector. For each line, there could be extra 3 numbers followed, please ignore. Following lattice section, there comes position section. As long as there is "position" case-insensitive leading the line, that is our position section. The position section consists of total lines of total atom number which is the from the first line. The lattice section, following by position section, then there are optional sections. The cue is always the words case-insensitive. After the keywords, following by the total lines of total atom number.
-
haveLattice
private boolean haveLattice
-
havePositions
private boolean havePositions
-
haveMagnetic
private boolean haveMagnetic
-
global3
private java.lang.String global3
-
-
Method Detail
-
initializeReader
protected void initializeReader() throws java.lang.Exception- Overrides:
initializeReaderin classAtomSetCollectionReader- Throws:
java.lang.Exception
-
checkLine
protected boolean checkLine() throws java.lang.Exception- Overrides:
checkLinein classAtomSetCollectionReader- Returns:
- true if need to read new line
- Throws:
java.lang.Exception
-
readComments
private void readComments()
-
readUnitCell
private void readUnitCell() throws java.lang.Exception- Throws:
java.lang.Exception
-
readCoordinates
private void readCoordinates() throws java.lang.Exception- Throws:
java.lang.Exception
-
readDataBlock
private boolean readDataBlock(java.lang.String name) throws java.lang.Exception- Throws:
java.lang.Exception
-
trimPWPropertyNameTo
private java.lang.String trimPWPropertyNameTo(java.lang.String name, java.lang.String chars)
-
readItems
private void readItems(java.lang.String name, int offset, float[] values) throws java.lang.Exception- Throws:
java.lang.Exception
-
setProperties
private void setProperties(java.lang.String name, float[] values, int n)
-
readVectors
private void readVectors(java.lang.String name, int offset, boolean haveLine) throws java.lang.Exception- Throws:
java.lang.Exception
-
getLine
private java.lang.String getLine() throws java.lang.Exception- Throws:
java.lang.Exception
-
removeComments
private java.lang.String removeComments()
-
setVectors
private void setVectors(java.lang.String name, float[] valuesX, float[] valuesY, float[] valuesZ, int n)
-
applySymmetryAndSetTrajectory
public void applySymmetryAndSetTrajectory() throws java.lang.Exception- Overrides:
applySymmetryAndSetTrajectoryin classAtomSetCollectionReader- Throws:
java.lang.Exception
-
finalizeSubclassReader
protected void finalizeSubclassReader() throws java.lang.ExceptionDescription copied from class:AtomSetCollectionReaderoptional reader-specific method run first.- Overrides:
finalizeSubclassReaderin classAtomSetCollectionReader- Throws:
java.lang.Exception
-
-