Class AdfReader
- All Implemented Interfaces:
GenericLineReader
- Direct Known Subclasses:
AmsReader
Molecular coordinates, energies, and normal coordinates of vibrations are read. Each set of coordinates is added to the ChemFile in the order they are found. Energies and vibrations are associated with the previously read set of coordinates.
This reader was developed from a small set of example output files, and therefore, is not guaranteed to properly read all ADF output. If you have problems, please contact the author of this code, not the developers of ADF.
Added note (Bob Hanson) -- 1/1/2010 -- Trying to implement reading of orbitals; ran into the problem that the atomic Slater description uses Cartesian orbitals, but the MO refers to spherical orbitals.
Added note (Diego Garay) -- 07/2023 Fixed support for geometry optimizations and frequencies, as only the first model (initial geometry) was being parsed for recent versions of ADF
- Version:
- 1.0
- Author:
- Bradley A. Smith (yeldar@home.com)
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.jmol.adapter.readers.quantum.BasisFunctionReader
BasisFunctionReader.MOEnergySorter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final double
protected String
protected static final double[]
protected Map
<String, AdfReader.SymmetryData> protected boolean
protected int
protected boolean
protected String
protected Lst
<AdfReader.SymmetryData> Fields inherited from class org.jmol.adapter.readers.quantum.MOReader
allowNoOrbitals, energyUnits, forceMOPAC, gaussianCount, gaussians, haveNboCharges, haveNboOrbitals, HEADER_GAMESS_OCCUPANCIES, HEADER_GAMESS_ORIGINAL, HEADER_GAMESS_UK_MO, HEADER_NONE, lastMoData, moTypes, orbitalsRead, shellCount
Fields inherited from class org.jmol.adapter.readers.quantum.BasisFunctionReader
alphaBeta, dfCoefMaps, ignoreMOs, moData, nCoef, nOrbitals, orbitals, shells, slaterArray, slaters
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, CELL_TYPE_SUPER, cellSlop, centroidPacked, checkNearAtoms, continuing, debugging, desiredModelNumber, desiredSpaceGroupIndex, desiredVibrationNumber, doApplySymmetry, doCentralize, doCentroidUnitCell, doCheckUnitCell, doConvertToFractional, doPackUnitCell, doProcessLines, doReadMolecularOrbitals, dssr, fileName, fileOffset, filePath, fileScaling, fillRange, filter, filterAllHetero, filterCased, filteredPrecision, filterHetero, floatifyJavaDouble, forcePacked, getHeader, haveAtomFilter, haveModel, havePartialChargeFilter, htParams, ignoreFileSpaceGroupName, ignoreFileSymmetryOperators, ignoreFileUnitCell, ignoreStructure, iHaveFractionalCoordinates, iHaveSymmetryOperators, iHaveUnitCell, is2D, isBinary, isConcatenated, isDSSP1, isFinalized, isMolecular, isPrimitive, isSequential, isSUPERCELL, isTrajectory, latticeCells, latticeScaling, latticeType, line, lowPrecision, lstNCS, matUnitCellOrientation, merging, modDim, modelNumber, ms, mustFinalizeModelSet, next, noHydrogens, noMinimize, noPack, optimize2D, out, paramsCentroid, paramsLattice, precision, 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 void
protected final SlaterData
addSlater
(int iAtom, int a, int b, int c, int d, double zeta, double coef) We build two data structures for each slater: int[] slaterInfo[] = {iatom, a, b, c, d} float[] slaterData[] = {zeta, coef} where psi = (coef)(x^a)(y^b)(z^c)(r^d)exp(-zeta*r) Mopac: a == -2 ==> z^2 ==> (coef)(2z^2-x^2-y^2)(r^d)exp(-zeta*r) and: b == -2 ==> (coef)(x^2-y^2)(r^d)exp(-zeta*r)protected void
addSlater
(SlaterData sd, int n) protected boolean
protected static double
fact
(double f, double zeta, int n) Sincere thanks to Miroslav Kohout (DGRID) for helping me get this right -- Bob Hanson, 1/5/2010 slater scaling based on zeta, n, l, and x y z exponents.protected static final double
getSlaterConstCartesian
(int n, double zeta, int el, int ex, int ey, int ez) scales slater using double factorials involving quantum number n, l, and xyz exponents.protected Lst
<SlaterData> void
protected void
Reads a set of coordinatesprotected void
Reads a set of vibrations.protected void
protected void
protected void
protected void
protected double
scaleSlater
(int ex, int ey, int ez, int er, double zeta) Perform implementation-specific scaling.protected final void
protected final void
setSlaters
(boolean doSort) after the vectors intinfo and floatinfo are completed, weprotected void
sortOrbitalCoefficients
(int[] pointers) sorts coefficients by atomic number for speed laterprotected void
sorts orbitals by energy rather than by symmetry so that we can use "MO HOMO" "MO HOMO - 1" "MO LUMO"Methods inherited from class org.jmol.adapter.readers.quantum.MOReader
addCoef, addMOData, addSlaterBasis, checkNboLine, getMOHeader, getNboTypes, readMolecularOrbitals, setMOData
Methods inherited from class org.jmol.adapter.readers.quantum.BasisFunctionReader
canonicalizeQuantumSubshellTag, clearOrbitals, discardPreviousAtoms, enableShell, filterMO, fixSlaterTypes, getDfCoefMaps, getDFMap, getQuantumShellTag, getQuantumShellTagID, getQuantumShellTagIDSpherical, setMO
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, doGetModel, doGetVibration, doPreSymmetry, fill3x3, fillDataBlock, fillDataBlockFixed, fillFloatArray, fillFrequencyData, filterAtom, filterReject, finalizeMOData, finalizeModelSet, finalizeReaderASCR, finalizeSubclassReader, finalizeSubclassSymmetry, fixDoubleA, fixFloatA, fixFloatPt, forceSymmetry, fractionalizeCoordinates, getElementSymbol, getFilter, getFilterWithCase, getFortranFormatLengths, getInterface, getPackingRangeValue, getStrings, getSymmetry, getTokens, getTokensFloat, initializeSymmetry, initializeSymmetryOptions, initializeTrajectoryFile, isLastModel, newAtomSet, parseFloat, parseFloatRange, parseFloatStr, parseInt, parseIntAt, parseIntRange, parseIntStr, parsePrecision, 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, setPrecision, setSpaceGroupName, setSymmetryOperator, setTransform, setUnitCell, setUnitCellItem, setup, setupASCR
-
Field Details
-
htSymmetries
-
vSymmetries
-
energy
-
nXX
protected int nXX -
symLine
-
isADF
protected boolean isADF -
scaleSlaters
protected boolean scaleSlaters -
_1_4pi
protected static final double _1_4pi- See Also:
-
fact_2n
protected static final double[] fact_2n
-
-
Constructor Details
-
AdfReader
public AdfReader()
-
-
Method Details
-
initializeReader
public void initializeReader()- Overrides:
initializeReader
in classMOReader
-
checkLine
- Overrides:
checkLine
in classAtomSetCollectionReader
- Returns:
- true if need to read new line
- Throws:
Exception
-
readOldFrequency
protected void readOldFrequency() -
readCoordinates
Reads a set of coordinates- Throws:
Exception
- if an I/O error occurs
-
readFrequencies
Reads a set of vibrations.- Throws:
Exception
- if an I/O error occurs
-
readSymmetries
- Throws:
Exception
-
readSlaterBasis
- Throws:
Exception
-
readMolecularOrbitals
- Throws:
Exception
-
addMo
-
addSlater
protected final SlaterData addSlater(int iAtom, int a, int b, int c, int d, double zeta, double coef) We build two data structures for each slater: int[] slaterInfo[] = {iatom, a, b, c, d} float[] slaterData[] = {zeta, coef} where psi = (coef)(x^a)(y^b)(z^c)(r^d)exp(-zeta*r) Mopac: a == -2 ==> z^2 ==> (coef)(2z^2-x^2-y^2)(r^d)exp(-zeta*r) and: b == -2 ==> (coef)(x^2-y^2)(r^d)exp(-zeta*r)- Parameters:
iAtom
- now 1-baseda
-b
-c
-d
-zeta
-coef
-
-
getSlaters
-
addSlater
-
setSlaters
protected final void setSlaters(boolean doSort) after the vectors intinfo and floatinfo are completed, we- Parameters:
doSort
- TODO
-
setMOs
-
sortOrbitalCoefficients
protected void sortOrbitalCoefficients(int[] pointers) sorts coefficients by atomic number for speed later- Parameters:
pointers
-
-
sortOrbitals
protected void sortOrbitals()sorts orbitals by energy rather than by symmetry so that we can use "MO HOMO" "MO HOMO - 1" "MO LUMO" -
scaleSlater
protected double scaleSlater(int ex, int ey, int ez, int er, double zeta) Perform implementation-specific scaling. This method is subclassed in MopacSlaterReader to handle spherical slaters- Parameters:
ex
-ey
-ez
-er
-zeta
-- Returns:
- scaling factor
-
fact
protected static double fact(double f, double zeta, int n) Sincere thanks to Miroslav Kohout (DGRID) for helping me get this right -- Bob Hanson, 1/5/2010 slater scaling based on zeta, n, l, and x y z exponents. sqrt[(2zeta)^(2n + 1) * f / 4pi / (2n)!] where f = (2 el + 1)!! / (2 ex - 1)!! / (2 ey - 1)!! / (2 ez - 1)!! The double factorials are precalculated.- Parameters:
f
-zeta
-n
-- Returns:
- scaled exponent
-
getSlaterConstCartesian
protected static final double getSlaterConstCartesian(int n, double zeta, int el, int ex, int ey, int ez) scales slater using double factorials involving quantum number n, l, and xyz exponents. fact2[x] is (2x - 1)!! Since x!! = 1 for x = 1, 0 or -1, we can just ignore this part for s and p orbitals, where x, y, and z are all 0 or 1. 7!! = 105 5!! = 15 3!! = 3 Numerators/4pi: all d orbitals: fact2[3] = (2*2 + 1)!! = 5!! = 15/4pi all f orbitals: fact2[4] = (2*3 + 1)!! = 7!! = 105/4pi Denominators: dxy, dyz, dxz all are 1 giving 15/4pi dx2, dy2, and dz2 all have one "2", giving 15/3!!/4pi or 5/4pi- Parameters:
n
-zeta
-el
-ex
-ey
-ez
-- Returns:
- scaled exponent
-