Class AdfReader

All Implemented Interfaces:
GenericLineReader
Direct Known Subclasses:
AmsReader

public class AdfReader extends MOReader
TODO: adf-2007.out causes failure reading basis functions A reader for ADF output. Amsterdam Density Functional (ADF) is a quantum chemistry program by Scientific Computing invalid input: '&' Modelling NV (SCM) (http://www.scm.com/).

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)
  • Field Details

  • Constructor Details

    • AdfReader

      public AdfReader()
  • Method Details

    • initializeReader

      public void initializeReader()
      Overrides:
      initializeReader in class MOReader
    • checkLine

      protected boolean checkLine() throws Exception
      Overrides:
      checkLine in class AtomSetCollectionReader
      Returns:
      true if need to read new line
      Throws:
      Exception
    • readOldFrequency

      protected void readOldFrequency()
    • readCoordinates

      protected void readCoordinates() throws Exception
      Reads a set of coordinates
      Throws:
      Exception - if an I/O error occurs
    • readFrequencies

      protected void readFrequencies() throws Exception
      Reads a set of vibrations.
      Throws:
      Exception - if an I/O error occurs
    • readSymmetries

      protected void readSymmetries() throws Exception
      Throws:
      Exception
    • readSlaterBasis

      protected void readSlaterBasis() throws Exception
      Throws:
      Exception
    • readMolecularOrbitals

      protected void readMolecularOrbitals(String sym) throws Exception
      Throws:
      Exception
    • addMo

      protected void addMo(String sym, int moPt, float occ, float energy)
    • 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"
    • 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