# Class GamessReader

java.lang.Object
org.jmol.adapter.smarter.AtomSetCollectionReader
org.jmol.adapter.readers.quantum.BasisFunctionReader
org.jmol.adapter.readers.quantum.MOReader
org.jmol.adapter.readers.quantum.GamessReader

All Implemented Interfaces:
  `GenericLineReader`

Direct Known Subclasses:
  `GamessUKReader, GamessUSReader`

public abstract class GamessReader extends MOReader

## Nested Class Summary

### Nested classes/interfaces inherited from class BasisFunctionReader

`BasisFunctionReader.MOEnergySorter`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected static final double`
`_1_4pi`
`protected boolean`
`allowMopacDCoef`
`protected int[]`
`atomicNumbers`
`protected Lst<String>`
`atomNames`
`protected static final double[]`
`fact_2n`
`protected static final float`
`MIN_COEF`
`static final String`
`MOPAC_TYPES`
`protected float[][]`
`mopacBasis`
GAMESS may need AM1, PMn, or RM1 zeta/coef data
`protected boolean`
`scaleSlaters`

### Fields inherited from class 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 BasisFunctionReader

`alphaBeta, dfCoefMaps, haveCoefs, ignoreMOs, moData, nCoef, nOrbitals, orbitals, shells, slaterArray, slaters`

### Fields inherited from class 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
Constructor
Description
`GamessReader()`

## Method Summary

Modifier and Type
Method
Description
`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 void`
`addSlaterBasis()`
When slater basis is referred to only by "AM1" "PM6" etc., as in GAMESS
`void`
`createMopacSlaters(int iAtom, int atomicNumber, float[] values, boolean allowD)`
`protected void`
`createSphericalSlaterByType(int iAtom, int atomicNumber, String type, double zeta, float coef)`
We have the type as a string and need to translate that to exponents for x, y, z, and r.
`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 String`
`fixBasisLine(String line)`
`protected abstract String`
`fixShellTag(String tag)`
`static float[][]`
`getMopacAtomZetaSPD(String type)`
Retrieve the MOPAC zeta(1/bohr) [s,p,d] array by atom number
`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>`
`getSlaters()`
`protected void`
`initializeReader()`
`protected abstract void`
`readAtomsInBohrCoordinates()`
`protected void`
`readBasisInfo()`
`protected void`
`readControlInfo()`
`protected void`
`readEnergy()`
`protected void`
`readFrequencies()`
`protected void`
`readGaussianBasis(String initiator, String terminator)`
`protected double`
`scaleSlater(int ex, int ey, int ez, int er, double zeta)`
overrides method in SlaterReader to allow for MOPAC's treatment of the radial exponent differently depending upon position in the periodic table -- noble gases and transition metals and for the fact that these are spherical functions (5D, not 6D) ignores any F orbitals.
`protected void`
`setAtom(Atom atom, int atomicNumber, String name, String id)`
`protected void`
`setCalculationType()`
`void`
`setMOData(boolean clearOrbitals)`
`protected final void`
`setMOs(String units)`
`protected final void`
`setSlaters(boolean doSort)`
after the vectors intinfo and floatinfo are completed, we
`protected void`
`sortOrbitalCoefficients(int[] pointers)`
sorts coefficients by atomic number for speed later
`protected void`
`sortOrbitals()`
sorts orbitals by energy rather than by symmetry so that we can use "MO HOMO" "MO HOMO - 1" "MO LUMO"

### Methods inherited from class MOReader

`addCoef, addMOData, checkNboLine, getMOHeader, getNboTypes, readMolecularOrbitals`

### Methods inherited from class BasisFunctionReader

`canonicalizeQuantumSubshellTag, clearOrbitals, discardPreviousAtoms, enableShell, filterMO, fixSlaterTypes, getDfCoefMaps, getDFMap, getQuantumShellTag, getQuantumShellTagID, getQuantumShellTagIDSpherical, setMO`

### Methods inherited from class AtomSetCollectionReader

`addAtomXYZSymName, addExplicitLatticeVector, addJmolScript, addMoreUnitCellInfo, addSites, addSiteScript, appendLoadNote, applySymmetryAndSetTrajectory, applySymTrajASCR, checkAndRemoveFilterKey, checkCurrentLineForScript, checkFilterKey, checkLastModel, checkLine, 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, warnSkippingOperation`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### atomNames

protected Lst<String> atomNames

### MIN_COEF

protected static final float MIN_COEF

See Also:
  - Constant Field Values

### atomicNumbers

protected int[] atomicNumbers

### mopacBasis

protected float[][] mopacBasis
GAMESS may need AM1, PMn, or RM1 zeta/coef data

### allowMopacDCoef

protected boolean allowMopacDCoef

### MOPAC_TYPES

public static final String MOPAC_TYPES

See Also:
  - Constant Field Values

### scaleSlaters

protected boolean scaleSlaters

### _1_4pi

protected static final double _1_4pi

See Also:
  - Constant Field Values

### fact_2n

protected static final double[] fact_2n

## Constructor Details

### GamessReader

public GamessReader()

## Method Details

### readAtomsInBohrCoordinates

protected abstract void readAtomsInBohrCoordinates() throws Exception

Throws:
  `Exception`

### initializeReader

protected void initializeReader() throws Exception

Overrides:
  `initializeReader` in class `MOReader`
Throws:
  `Exception`

### setAtom

protected void setAtom(Atom atom, int atomicNumber, String name, String id)

### readEnergy

protected void readEnergy()

### readGaussianBasis

protected void readGaussianBasis(String initiator, String terminator) throws Exception

Throws:
  `Exception`

### fixShellTag

protected abstract String fixShellTag(String tag)

### readFrequencies

protected void readFrequencies() throws Exception

Throws:
  `Exception`

### fixBasisLine

protected static String fixBasisLine(String line)

### setCalculationType

protected void setCalculationType()

### readControlInfo

protected void readControlInfo() throws Exception

Throws:
  `Exception`

### readBasisInfo

protected void readBasisInfo() throws Exception

Throws:
  `Exception`

### scaleSlater

protected double scaleSlater(int ex, int ey, int ez, int er, double zeta)
overrides method in SlaterReader to allow for MOPAC's treatment of the radial exponent differently depending upon position in the periodic table -- noble gases and transition metals and for the fact that these are spherical functions (5D, not 6D) ignores any F orbitals.

Parameters:
  `ex` -
  `ey` -
  `ez` -
  `er` -
  `zeta` -
Returns:
  scaling factor

### setMOData

public void setMOData(boolean clearOrbitals)

Overrides:
  `setMOData` in class `MOReader`

### addSlaterBasis

protected void addSlaterBasis()
When slater basis is referred to only by "AM1" "PM6" etc., as in GAMESS

Overrides:
  `addSlaterBasis` in class `MOReader`

### createMopacSlaters

public void createMopacSlaters(int iAtom, int atomicNumber, float[] values, boolean allowD)

### createSphericalSlaterByType

protected void createSphericalSlaterByType(int iAtom, int atomicNumber, String type, double zeta, float coef)
We have the type as a string and need to translate that to exponents for x, y, z, and r. No F here.

Parameters:
  `iAtom` -
  `atomicNumber` -
  `type` -
  `zeta` -
  `coef` -

### getMopacAtomZetaSPD

public static float[][] getMopacAtomZetaSPD(String type)
Retrieve the MOPAC zeta(1/bohr) [s,p,d] array by atom number

Parameters:
  `type` -
Returns:
  [[zs,zp,zd],[zs,zp,zd]...] where [1] is for hydrogen, [6] is for carbon, etc.

### 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-based
  `a` -
  `b` -
  `c` -
  `d` -
  `zeta` -
  `coef` -

### getSlaters

protected Lst<SlaterData> getSlaters()

### addSlater

protected void addSlater(SlaterData sd, int n)

### setSlaters

protected final void setSlaters(boolean doSort)
after the vectors intinfo and floatinfo are completed, we

Parameters:
  `doSort` - TODO

### setMOs

protected final void setMOs(String units)

### 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"

### 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