Beispiel #1
0
  void MopacAux::processLine()
  {
    // First truncate the line, remove trailing white space and check
    QString line = m_in.readLine();
    QString key = line;
    key = key.trimmed();
//    QStringList list = tmp.split("=", QString::SkipEmptyParts);

    // Big switch statement checking for various things we are interested in
    if (key.contains("ATOM_EL")) {
      QString tmp = key.mid(key.indexOf('[')+1, 4);
      qDebug() << "Number of atoms =" << tmp.toInt();
    }
    else if (key.contains("AO_ATOMINDEX")) {
      QString tmp = key.mid(key.indexOf('[')+1, 4);
      qDebug() << "Number of atomic orbitals =" << tmp.toInt();
      m_atomIndex = readArrayI(tmp.toInt());
      for (unsigned int i = 0; i < m_atomIndex.size(); ++i) {
        --m_atomIndex[i];
      }
    }
    else if (key.contains("ATOM_SYMTYPE")) {
      QString tmp = key.mid(key.indexOf('[')+1, 4);
      qDebug() << "Number of atomic orbital types =" << tmp.toInt();
      m_atomSym = readArraySym(tmp.toInt());
    }
    else if (key.contains("AO_ZETA")) {
      QString tmp = key.mid(key.indexOf('[')+1, 4);
      qDebug() << "Number of zeta values =" << tmp.toInt();
      m_zeta = readArrayD(tmp.toInt());
    }
    else if (key.contains("ATOM_PQN")) {
      QString tmp = key.mid(key.indexOf('[')+1, 4);
      qDebug() << "Number of PQN values =" << tmp.toInt();
      m_pqn = readArrayI(tmp.toInt());
    }
    else if (key.contains("NUM_ELECTRONS")) {
      QString tmp = key.split('=').at(1);
      qDebug() << "Number of electrons =" << tmp.toInt();
      m_electrons = tmp.toInt();
    }
    else if (key.contains("ATOM_X_OPT:ANGSTROMS")) {
      QString tmp = key.mid(key.indexOf('[')+1, 4);
      qDebug() << "Number of atomic coordinates =" << tmp.toInt();
      m_atomPos = readArrayVec(tmp.toInt());
    }
    else if (key.contains("OVERLAP_MATRIX")) {
      QString tmp = key.mid(key.indexOf('[')+1, 6);
      qDebug() << "Size of lower half triangle of overlap matrix =" << tmp.toInt();
      readOverlapMatrix(tmp.toInt());
    }
    else if (key.contains("EIGENVECTORS")) {
      // For large molecules the Eigenvectors counter overflows to [*****]
      // So just use the square of the m_atomIndex array
//      QString tmp = key.mid(key.indexOf('[')+1, 6);
      qDebug() << "Size of eigen vectors matrix ="
          << m_atomIndex.size() * m_atomIndex.size();
      readEigenVectors(m_atomIndex.size() * m_atomIndex.size());
    }
    else if (key.contains("TOTAL_DENSITY_MATRIX")) {
      QString tmp = key.mid(key.indexOf('[')+1, 6);
      qDebug() << "Size of lower half triangle of density matrix =" << tmp.toInt();
      readDensityMatrix(tmp.toInt());
    }
  }
Beispiel #2
0
void GaussianFchk::processLine()
{
  // First truncate the line, remove trailing white space and check
  QString line = m_in->readLine();
  if (line.isEmpty())
    return;
  QString key = line;
  key.resize(42);
  key = key.trimmed();

  QString tmp = line.mid(43, 37);
  QStringList list = tmp.split(' ', QString::SkipEmptyParts);

  // Big switch statement checking for various things we are interested in
  if (key == "Number of atoms")
    qDebug() << "Number of atoms =" << list.at(1).toInt();
  else if (key == "Number of electrons")
    m_electrons = list.at(1).toInt();
  else if (key == "Number of basis functions") {
    m_numBasisFunctions = list.at(1).toInt();
    qDebug() << "Number of basis functions =" << m_numBasisFunctions;
  }
  else if (key == "Atomic numbers") {
    m_aNums = readArrayI(list.at(2).toInt());
    if (static_cast<int>(m_aNums.size()) != list.at(2).toInt())
      qDebug() << "Reading atomic numbers failed.";
    else
      qDebug() << "Reading atomic numbers succeeded.";
  }
  // Now we get to the meat of it - coordinates of the atoms
  else if (key == "Current cartesian coordinates")
    m_aPos = readArrayD(list.at(2).toInt(), 16);
  // The real meat is here - basis sets etc!
  else if (key == "Shell types")
    m_shellTypes = readArrayI(list.at(2).toInt());
  else if (key == "Number of primitives per shell")
    m_shellNums = readArrayI(list.at(2).toInt());
  else if (key == "Shell to atom map")
    m_shelltoAtom = readArrayI(list.at(2).toInt());
  // Now to get the exponents and coefficients(
  else if (key == "Primitive exponents")
    m_a = readArrayD(list.at(2).toInt(), 16);
  else if (key == "Contraction coefficients")
    m_c = readArrayD(list.at(2).toInt(), 16);
  else if (key == "P(S=P) Contraction coefficients")
    m_csp = readArrayD(list.at(2).toInt(), 16);
  else if (key == "Alpha Orbital Energies") {
    m_orbitalEnergy = readArrayD(list.at(2).toInt(), 16);
    qDebug() << "MO energies, n =" << m_orbitalEnergy.size();
  }
  else if (key == "Alpha MO coefficients") {
    m_MOcoeffs = readArrayD(list.at(2).toInt(), 16);
    if (static_cast<int>(m_MOcoeffs.size()) == list.at(2).toInt())
      qDebug() << "MO coefficients, n =" << m_MOcoeffs.size();
    else
      qDebug() << "Error, MO coefficients, n =" << m_MOcoeffs.size();
  }
  else if (key == "Total SCF Density") {
    if (readDensityMatrix(list.at(2).toInt(), 16))
      qDebug() << "SCF density matrix read in" << m_density.rows();
    else
      qDebug() << "Error reading in the SCF density matrix.";
  }
}