Debian Codegraph @

avogadro/quantumio/gamessus.h

raw
1 /******************************************************************************
2 This source file is part of the Avogadro project.
3 This source code is released under the 3-Clause BSD License, (see "LICENSE").
4 ******************************************************************************/
5
6 #ifndef AVOGADRO_QUANTUMIO_GAMESSUS_H
7 #define AVOGADRO_QUANTUMIO_GAMESSUS_H
8
9 #include "avogadroquantumioexport.h"
10 #include <avogadro/core/gaussianset.h>
11 #include <avogadro/io/fileformat.h>
12
13 #include <vector>
14
15 namespace Avogadro {
16 namespace QuantumIO {
17
18 class AVOGADROQUANTUMIO_EXPORT GAMESSUSOutput : public Io::FileFormat
19 {
20 public:
21 GAMESSUSOutput();
22 ~GAMESSUSOutput() override;
23
24 Operations supportedOperations() const override
25 {
26 return Read | File | Stream | String;
27 }
28
29 FileFormat* newInstance() const override { return new GAMESSUSOutput; }
30 std::string identifier() const override { return "Avogadro: GAMESS"; }
31 std::string name() const override { return "GAMESS"; }
32 std::string description() const override
33 {
34 return "GAMESS US log file output parser.";
35 }
36
37 std::string specificationUrl() const override { return ""; }
38
39 std::vector<std::string> fileExtensions() const override;
40 std::vector<std::string> mimeTypes() const override;
41
42 [[nodiscard]] bool read(std::istream& in, Core::Molecule& molecule) override;
43 [[nodiscard]] bool write(std::ostream&, const Core::Molecule&) override
44 {
45 // Empty, as we do not write out GAMESS log files.
46 return false;
47 }
48
49 private:
50 /**
51 * @brief Read the atom block of the log file.
52 * @param in Our input stream.
53 * @param molecule The molecule to add the atoms to.
54 * @param angs Whether the units are Angstroms (true) or Bohr (false).
55 */
56 void readAtomBlock(std::istream& in, Core::Molecule& molecule, bool angs);
57
58 /**
59 * Read in the basis set block.
60 */
61 void readBasisSet(std::istream& in);
62
63 /**
64 * Read in the molecular orbitals.
65 */
66 void readEigenvectors(std::istream& in);
67
68 /**
69 * Reorder the molecular orbitals.
70 */
71 void reorderMOs();
72
73 /**
74 * Outpull all known properties that have been read, useful for debugging.
75 */
76 void outputAll();
77
78 /**
79 * Load the basis with the properties read in from the file.
80 */
81 void load(Core::GaussianSet* basis);
82
83 double m_coordFactor;
84 int m_electrons;
85 int m_electronsA;
86 int m_electronsB;
87 int m_nMOs;
88 Core::ScfType m_scftype;
89 unsigned int m_numBasisFunctions;
90 std::vector<Core::GaussianSet::orbital> m_shellTypes;
91 std::vector<int> m_shellNums;
92 std::vector<int> m_shelltoAtom;
93 std::vector<double> m_a;
94 std::vector<double> m_c;
95 std::vector<double> m_csp;
96 std::vector<double> m_orbitalEnergy;
97 std::vector<double> m_alphaOrbitalEnergy;
98 std::vector<double> m_betaOrbitalEnergy;
99 std::vector<double> m_MOcoeffs;
100 std::vector<double> m_alphaMOcoeffs;
101 std::vector<double> m_betaMOcoeffs;
102
103 MatrixX m_density; /// Total density matrix
104 };
105 } // namespace QuantumIO
106 } // namespace Avogadro
107
108 #endif