@@ -25,6 +25,9 @@ using Core::Rhf;
25
25
using Core::Rohf;
26
26
using Core::Uhf;
27
27
28
+ // https://physics.nist.gov/cgi-bin/cuu/Value?hrev
29
+ const double hartreeToEV = 27.211386245981 ;
30
+
28
31
GaussianFchk::GaussianFchk () : m_scftype(Rhf) {}
29
32
30
33
GaussianFchk::~GaussianFchk () {}
@@ -158,17 +161,14 @@ void GaussianFchk::processLine(std::istream& in)
158
161
m_csp = readArrayD (in, Core::lexicalCast<int >(list[2 ]), 16 );
159
162
} else if (key == " Alpha Orbital Energies" ) {
160
163
if (m_scftype == Rhf) {
161
- m_orbitalEnergy = readArrayD (in, Core::lexicalCast< int >(list[ 2 ]), 16 );
162
- // cout << "MO energies, n = " << m_orbitalEnergy.size() << endl ;
164
+ m_orbitalEnergy =
165
+ readArrayD (in, Core::lexicalCast< int >(list[ 2 ]), 16 , hartreeToEV) ;
163
166
} else if (m_scftype == Uhf) {
164
167
m_alphaOrbitalEnergy =
165
- readArrayD (in, Core::lexicalCast<int >(list[2 ]), 16 );
166
- // cout << "Alpha MO energies, n = " << m_alphaOrbitalEnergy.size() <<
167
- // endl;
168
+ readArrayD (in, Core::lexicalCast<int >(list[2 ]), 16 , hartreeToEV);
168
169
}
169
170
} else if (key == " Beta Orbital Energies" ) {
170
171
if (m_scftype != Uhf) {
171
- // cout << "UHF detected. Reassigning Alpha properties." << endl;
172
172
m_scftype = Uhf;
173
173
m_alphaOrbitalEnergy = m_orbitalEnergy;
174
174
m_orbitalEnergy = vector<double >();
@@ -177,8 +177,8 @@ void GaussianFchk::processLine(std::istream& in)
177
177
m_MOcoeffs = vector<double >();
178
178
}
179
179
180
- m_betaOrbitalEnergy = readArrayD (in, Core::lexicalCast< int >(list[ 2 ]), 16 );
181
- // cout << "Beta MO energies, n = " << m_betaOrbitalEnergy.size() << endl ;
180
+ m_betaOrbitalEnergy =
181
+ readArrayD (in, Core::lexicalCast< int >(list[ 2 ]), 16 , hartreeToEV) ;
182
182
} else if (key == " Alpha MO coefficients" && list.size () > 2 ) {
183
183
if (m_scftype == Rhf) {
184
184
m_MOcoeffs = readArrayD (in, Core::lexicalCast<int >(list[2 ]), 16 );
@@ -379,7 +379,7 @@ vector<int> GaussianFchk::readArrayI(std::istream& in, unsigned int n)
379
379
}
380
380
381
381
vector<double > GaussianFchk::readArrayD (std::istream& in, unsigned int n,
382
- int width)
382
+ int width, double factor )
383
383
{
384
384
vector<double > tmp;
385
385
tmp.reserve (n);
@@ -402,7 +402,7 @@ vector<double> GaussianFchk::readArrayD(std::istream& in, unsigned int n,
402
402
<< tmp.size () << " of " << n << endl;
403
403
return tmp;
404
404
}
405
- tmp.push_back (Core::lexicalCast<double >(i, ok));
405
+ tmp.push_back (Core::lexicalCast<double >(i, ok) * factor );
406
406
if (!ok) {
407
407
cout << " Warning: problem converting string to integer: " << i
408
408
<< " in GaussianFchk::readArrayD.\n " ;
@@ -420,7 +420,7 @@ vector<double> GaussianFchk::readArrayD(std::istream& in, unsigned int n,
420
420
<< tmp.size () << " of " << n << endl;
421
421
return tmp;
422
422
}
423
- tmp.push_back (Core::lexicalCast<double >(substring, ok));
423
+ tmp.push_back (Core::lexicalCast<double >(substring, ok) * factor );
424
424
if (!ok) {
425
425
cout << " Warning: problem converting string to double: " << substring
426
426
<< " in GaussianFchk::readArrayD.\n " ;
0 commit comments