Skip to content

Commit

Permalink
Add orca import (OpenChemistry#1326)
Browse files Browse the repository at this point in the history
Add ORCA output file import (porting 1.2 code)

* Initial support for geometry import 
* Add support for reading vibrations and IR
* Support open shell calculations and orbital energies

Signed-off-by: Geoff Hutchison <[email protected]>
  • Loading branch information
ghutchis authored Sep 2, 2023
1 parent fc24a96 commit 2097995
Show file tree
Hide file tree
Showing 6 changed files with 983 additions and 99 deletions.
27 changes: 11 additions & 16 deletions avogadro/core/gaussianset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ GaussianSet::GaussianSet() : m_numMOs(0), m_init(false)
m_scfType = Rhf;
}

GaussianSet::~GaussianSet()
{
}
GaussianSet::~GaussianSet() {}

unsigned int GaussianSet::addBasis(unsigned int atom, orbital type)
{
Expand Down Expand Up @@ -184,12 +182,6 @@ bool GaussianSet::setSpinDensityMatrix(const MatrixX& m)
return true;
}

bool GaussianSet::generateDensityMatrix()
{
// FIXME: Finish me!
return true;
}

unsigned int GaussianSet::molecularOrbitalCount(ElectronType type)
{
size_t index(0);
Expand Down Expand Up @@ -479,7 +471,7 @@ void GaussianSet::initCalculation()
m_init = true;
}

bool GaussianSet::generateDensity()
bool GaussianSet::generateDensityMatrix()
{
if (m_scfType == Unknown)
return false;
Expand All @@ -496,9 +488,11 @@ bool GaussianSet::generateDensity()
m_density(jBasis, iBasis) += 2.0 * icoeff * jcoeff;
m_density(iBasis, jBasis) = m_density(jBasis, iBasis);
}
cout << iBasis << ", " << jBasis << ": " << m_density(iBasis, jBasis)
<< endl;
// cout << iBasis << ", " << jBasis << ": " <<
// m_density(iBasis, jBasis)
// << endl;
break;
case Rohf: // ROHF is handled similarly to UHF
case Uhf:
for (unsigned int iaMO = 0; iaMO < m_electrons[0]; ++iaMO) {
double icoeff = m_moMatrix[0](iBasis, iaMO);
Expand All @@ -512,8 +506,9 @@ bool GaussianSet::generateDensity()
m_density(jBasis, iBasis) += icoeff * jcoeff;
m_density(iBasis, jBasis) = m_density(jBasis, iBasis);
}
cout << iBasis << ", " << jBasis << ": " << m_density(iBasis, jBasis)
<< endl;
// cout << iBasis << ", " << jBasis << ": " <<
// m_density(iBasis, jBasis)
// << endl;
break;
default:
cout << "Unhandled scf type:" << m_scfType << endl;
Expand All @@ -523,7 +518,7 @@ bool GaussianSet::generateDensity()
return true;
}

bool GaussianSet::generateSpinDensity()
bool GaussianSet::generateSpinDensityMatrix()
{
if (m_scfType != Uhf)
return false;
Expand Down Expand Up @@ -551,4 +546,4 @@ bool GaussianSet::generateSpinDensity()
return true;
}

} // End namespace Avogadro
} // namespace Avogadro::Core
24 changes: 9 additions & 15 deletions avogadro/core/gaussianset.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,13 @@ class AVOGADROCORE_EXPORT GaussianSet : public BasisSet
*/
bool generateDensityMatrix();

/**
* @brief Generate the spin density matrix if we have the required
* information.
* @return True on success, false on failure.
*/
bool generateSpinDensityMatrix();

/**
* @return The number of molecular orbitals in the GaussianSet.
*/
Expand Down Expand Up @@ -357,22 +364,9 @@ class AVOGADROCORE_EXPORT GaussianSet : public BasisSet
ScfType m_scfType;

std::string m_functionalName;

/**
* @brief Generate the density matrix if we have the required information.
* @return True on success, false on failure.
*/
bool generateDensity();

/**
* @brief Generate the spin density matrix if we have the required
* information.
* @return True on success, false on failure.
*/
bool generateSpinDensity();
};

} // End Core namespace
} // End Avogadro namespace
} // namespace Core
} // namespace Avogadro

#endif
Loading

0 comments on commit 2097995

Please sign in to comment.