Skip to content

Commit

Permalink
Add charge, spin, and dipole moment to fchk files
Browse files Browse the repository at this point in the history
Signed-off-by: Geoff Hutchison <[email protected]>
  • Loading branch information
ghutchis committed Nov 18, 2024
1 parent a6fd134 commit 6c3a053
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
12 changes: 12 additions & 0 deletions avogadro/quantumio/gaussianfchk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ bool GaussianFchk::read(std::istream& in, Core::Molecule& molecule)
molecule.setVibrationRamanIntensities(m_RamanIntensities);
}

// set the total charge
molecule.setData("totalCharge", m_charge);
// set the spin multiplicity
molecule.setData("totalSpinMultiplicity", m_spin);
// dipole moment
molecule.setData("dipoleMoment", m_dipoleMoment);

// Do simple bond perception.
molecule.perceiveBondsSimple();
molecule.perceiveBondOrders();
Expand Down Expand Up @@ -108,6 +115,11 @@ void GaussianFchk::processLine(std::istream& in)
m_charge = Core::lexicalCast<signed char>(list[1]);
} else if (key == "Multiplicity" && list.size() > 1) {
m_spin = Core::lexicalCast<char>(list[1]);
} else if (key == "Dipole Moment" && list.size() > 2) {
vector<double> dipole = readArrayD(in, Core::lexicalCast<int>(list[2]));
m_dipoleMoment = Vector3(dipole[0], dipole[1], dipole[2]);
// convert from au
m_dipoleMoment *= 2.541746;
} else if (key == "Number of electrons" && list.size() > 1) {
m_electrons = Core::lexicalCast<int>(list[1]);
} else if (key == "Number of alpha electrons" && list.size() > 1) {
Expand Down
1 change: 1 addition & 0 deletions avogadro/quantumio/gaussianfchk.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class AVOGADROQUANTUMIO_EXPORT GaussianFchk : public Io::FileFormat
std::vector<double> m_betaMOcoeffs;
MatrixX m_density; /// Total density matrix
MatrixX m_spinDensity; /// Spin density matrix
Vector3 m_dipoleMoment;
Core::ScfType m_scftype;

Core::Array<double> m_frequencies;
Expand Down
9 changes: 9 additions & 0 deletions avogadro/quantumio/orca.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ class AVOGADROQUANTUMIO_EXPORT ORCAOutput : public Io::FileFormat
std::vector<int> m_atomNums;
std::vector<Eigen::Vector3d> m_atomPos;

Eigen::Vector3d m_dipoleMoment;

std::vector<std::vector<int>> m_bondOrders;

std::vector<int> shellFunctions;
Expand All @@ -84,6 +86,7 @@ class AVOGADROQUANTUMIO_EXPORT ORCAOutput : public Io::FileFormat
IR,
Raman,
Electronic,
ECD, // electronic circular dichroism
NMR,
BondOrders,
NotParsing,
Expand All @@ -98,6 +101,8 @@ class AVOGADROQUANTUMIO_EXPORT ORCAOutput : public Io::FileFormat
bool m_readBeta;

int m_homo;
int m_charge;

Check notice on line 104 in avogadro/quantumio/orca.h

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

avogadro/quantumio/orca.h#L104

class member 'ORCAOutput::m_charge' is never used.
int m_spin;

Check notice on line 105 in avogadro/quantumio/orca.h

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

avogadro/quantumio/orca.h#L105

class member 'ORCAOutput::m_spin' is never used.

int m_currentAtom;
unsigned int m_numBasisFunctions;
Expand All @@ -119,6 +124,10 @@ class AVOGADROQUANTUMIO_EXPORT ORCAOutput : public Io::FileFormat
Core::Array<double> m_IRintensities;
Core::Array<double> m_RamanIntensities;
Core::Array<Core::Array<Vector3>> m_vibDisplacements;

Core::Array<double> m_electronicTransitions; // in eV
Core::Array<double> m_electronicIntensities;
Core::Array<double> m_electronicRotations; // for CD
};

} // namespace QuantumIO
Expand Down

0 comments on commit 6c3a053

Please sign in to comment.