Esempio n. 1
0
bool GaussianOutputFile::readStandardGeometries(vector<Molecule>& molecules)
{
    Atom atom;
    Molecule mol;
    string line;
    bool ok;

    ok = false;

    while(isStringInFile("completed"))
    {
        if(isStringInFile("Standard orientation"))
        {
            /*
             * Jumping four lines that contains the orientation header
             *
             */
            for(size_t i = 0; i < 4; i++)
                line = readLine();

            /*
             * Reading the atoms
             *
             */
            line = readLine();
            while(line.find("-------") == string::npos)
            {
                atom.clear();
                atom.setName(line.substr(13,16));
                atom.setX(atof(line.substr(33,46).c_str()));
                atom.setY(atof(line.substr(47,59).c_str()));
                atom.setZ(atof(line.substr(60,70).c_str()));
                mol.addAtom(atom);
                line = readLine();
            }

            molecules.push_back(mol);

            mol.clear();

            ok = true;
        }
    }

    if(ok)
        return true;
    else
        return false;
}
Esempio n. 2
0
bool GaussianOutputFile::readMullikenCharges(Molecule& mol)
{
    string line;
    size_t i;
    Atom atom;

    rewind();

    if(isStringInFile("Mulliken atomic charges:"))
    {
        /*
         * Jumping the junk line
         */
        line = readLine();

        i = 0;
        line = readLine();
        while(line.find("Sum of Mulliken atomic charges") == string::npos)
        {
            atom.clear();
            atom = mol.at(i);
            atom.setCharge(atof(line.substr(10,21).c_str()));

            mol.replace(i,atom);

            line = readLine();
            i++;
        }
    }
    else
        return false;

    return true;
}
Esempio n. 3
0
void rootLoginSSH(const char *searchString){
    // Check to see if insecure configuration options are removed
    // in /etc/ssh/sshd_config

    if( isStringInFile("/etc/ssh/sshd_config", searchString ) == false){
        std::cout << success << " Root SSH login has been disabled." << std::endl;
            total += 10;
    }
}
Esempio n. 4
0
bool GaussianOutputFile::readFirstInputOrientationGeometry(Molecule& mol)
{
    Atom atom;
    string line;

    if(!rewind())
        return false;

    if(isStringInFile("Input orientation"))
    {
        /*
         * Jumping four lines that contains the orientation header
         *
         */
        for(size_t i = 0; i < 4; i++)
            line = readLine();

        /*
         * Reading the atoms
         *
         */
        line = readLine();
        while(line.find("-------") == string::npos)
        {
            atom.clear();
            atom.setName(line.substr(13,16));
            atom.setX(atof(line.substr(33,46).c_str()));
            atom.setY(atof(line.substr(47,59).c_str()));
            atom.setZ(atof(line.substr(60,70).c_str()));
            mol.addAtom(atom);
            line = readLine();


        }

    }
    else
        return false;

    return true;
}