Package org.jmol.adapter.readers.xtal
Class MagresReader
- java.lang.Object
-
- org.jmol.adapter.smarter.AtomSetCollectionReader
-
- org.jmol.adapter.readers.xtal.MagresReader
-
- All Implemented Interfaces:
javajs.api.GenericLineReader
public class MagresReader extends AtomSetCollectionReader
-
-
Field Summary
Fields Modifier and Type Field Description private static intBLOCK_ATOMSprivate static intBLOCK_CALCprivate static intBLOCK_MAGRESprivate static intBLOCK_NEWprivate static intBLOCK_NONEprivate float[]cellParamsprivate intcurrentBlockprivate javajs.util.SBheaderprivate javajs.util.Lst<Tensor>interactionTensorsprivate java.util.Map<java.lang.String,java.lang.String>magresUnits-
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, isMolecular, 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 MagresReader()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private intcheckBlock()looking for tags here.protected booleancheckLine()Valid blocks include [calculation] [atoms] [magres]; all magres entries must be prefaced with a corresponding unit; Use of < > instead of [ ] is allowed.protected voidfinalizeSubclassReader()Set final auxiliary info and symmetry, including "fileHeader", "magresUnits", and "interactionTensors"; note that print getProperty("auxiliaryInfo.models[1].magresUnits") should return a catalog of tensor types.private static java.lang.StringgetAtomName(java.lang.String name, java.lang.String index)combine name and indexprotected voidinitializeReader()not sure how to work with symmetry here...private booleanreadAtom()Allowing for BOHR units here; probably unnecessary.private booleanreadCellParams()private booleanreadSymmetry()not doing anything with this -- P1 assumedprivate booleanreadTensor()Read a tensor line.private booleansetUnits(boolean isMagresBlock)catalog unitsprivate booleantrimLine()All characters after hash ignored; lines are trimmed.-
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
-
BLOCK_NEW
private static final int BLOCK_NEW
- See Also:
- Constant Field Values
-
BLOCK_NONE
private static final int BLOCK_NONE
- See Also:
- Constant Field Values
-
BLOCK_CALC
private static final int BLOCK_CALC
- See Also:
- Constant Field Values
-
BLOCK_ATOMS
private static final int BLOCK_ATOMS
- See Also:
- Constant Field Values
-
BLOCK_MAGRES
private static final int BLOCK_MAGRES
- See Also:
- Constant Field Values
-
currentBlock
private int currentBlock
-
cellParams
private float[] cellParams
-
magresUnits
private java.util.Map<java.lang.String,java.lang.String> magresUnits
-
interactionTensors
private javajs.util.Lst<Tensor> interactionTensors
-
header
private javajs.util.SB header
-
-
Method Detail
-
initializeReader
protected void initializeReader()
not sure how to work with symmetry here...- Overrides:
initializeReaderin classAtomSetCollectionReader
-
finalizeSubclassReader
protected void finalizeSubclassReader() throws java.lang.ExceptionSet final auxiliary info and symmetry, including "fileHeader", "magresUnits", and "interactionTensors"; note that print getProperty("auxiliaryInfo.models[1].magresUnits") should return a catalog of tensor types.- Overrides:
finalizeSubclassReaderin classAtomSetCollectionReader- Throws:
java.lang.Exception
-
checkLine
protected boolean checkLine() throws java.lang.ExceptionValid blocks include [calculation] [atoms] [magres]; all magres entries must be prefaced with a corresponding unit; Use of < > instead of [ ] is allowed.- Overrides:
checkLinein classAtomSetCollectionReader- Returns:
- true to read another line (some readers return false because they have over-read a line)
- Throws:
java.lang.Exception
-
trimLine
private boolean trimLine()
All characters after hash ignored; lines are trimmed.- Returns:
- true if line has content
-
checkBlock
private int checkBlock()
looking for tags here.- Returns:
- currentBlock if not a tag or BLOCK_NEW otherwise
-
setUnits
private boolean setUnits(boolean isMagresBlock)
catalog units- Parameters:
isMagresBlock-- Returns:
- true
-
readSymmetry
private boolean readSymmetry()
not doing anything with this -- P1 assumed- Returns:
- true
-
readCellParams
private boolean readCellParams() throws java.lang.Exception- Returns:
- true;
- Throws:
java.lang.Exception
-
readAtom
private boolean readAtom()
Allowing for BOHR units here; probably unnecessary.- Returns:
- true
-
getAtomName
private static java.lang.String getAtomName(java.lang.String name, java.lang.String index)combine name and index- Parameters:
name-index-- Returns:
- name_index
-
readTensor
private boolean readTensor() throws java.lang.ExceptionRead a tensor line. Note that a corresponding unit line must have appeared first.- Returns:
- true;
- Throws:
java.lang.Exception
-
-