Skip to content

Commit

Permalink
Fix parsing "Gaussian" vibration output from xtb program
Browse files Browse the repository at this point in the history
  • Loading branch information
ghutchis committed Dec 1, 2023
1 parent ef2b499 commit 824587a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/formats/gaussformat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ namespace OpenBabel

//Vibrational data
std::vector< std::vector< vector3 > > Lx;
std::vector<double> Frequencies, Intensities;
std::vector<double> Frequencies, Intensities, RamanActivities;
//Rotational data
std::vector<double> RotConsts(3);
int RotSymNum=1;
Expand Down Expand Up @@ -979,8 +979,11 @@ namespace OpenBabel
ifs.getline(buffer, BUFF_SIZE); // column labels or Raman intensity
if(strstr(buffer, "Raman Activ")) {
ifs.getline(buffer, BUFF_SIZE); // Depolar (P)
ifs.getline(buffer, BUFF_SIZE); // Depolar (U)
ifs.getline(buffer, BUFF_SIZE); // column labels
for(unsigned int i=3; i<vs.size(); ++i)
RamanActivities.push_back(atof(vs[i].c_str()));

while (strstr(buffer, "Atom") == nullptr)
ifs.getline(buffer, BUFF_SIZE); // eventually column labels
}
ifs.getline(buffer, BUFF_SIZE); // actual displacement data
tokenize(vs, buffer);
Expand Down Expand Up @@ -1325,7 +1328,10 @@ namespace OpenBabel
if(Frequencies.size()>0)
{
OBVibrationData* vd = new OBVibrationData;
vd->SetData(Lx, Frequencies, Intensities);
if (RamanActivities.size() != 0) {
vd->SetData(Lx, Frequencies, Intensities, RamanActivities);
} else
vd->SetData(Lx, Frequencies, Intensities);
vd->SetOrigin(fileformatInput);
mol.SetData(vd);
}
Expand Down

0 comments on commit 824587a

Please sign in to comment.