| 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_MOPACAUX_H |
| 7 |
#define AVOGADRO_QUANTUMIO_MOPACAUX_H |
| 8 |
|
| 9 |
#include "avogadroquantumioexport.h" |
| 10 |
#include <avogadro/core/array.h> |
| 11 |
#include <avogadro/core/slaterset.h> |
| 12 |
#include <avogadro/io/fileformat.h> |
| 13 |
|
| 14 |
#include <vector> |
| 15 |
|
| 16 |
namespace Avogadro { |
| 17 |
namespace QuantumIO { |
| 18 |
|
| 19 |
class AVOGADROQUANTUMIO_EXPORT MopacAux : public Io::FileFormat |
| 20 |
{ |
| 21 |
public: |
| 22 |
MopacAux(); |
| 23 |
~MopacAux() override; |
| 24 |
void outputAll(); |
| 25 |
|
| 26 |
Operations supportedOperations() const override |
| 27 |
{ |
| 28 |
return Read | File | Stream | String; |
| 29 |
} |
| 30 |
|
| 31 |
FileFormat* newInstance() const override { return new MopacAux; } |
| 32 |
std::string identifier() const override { return "Avogadro: MOPAC"; } |
| 33 |
std::string name() const override { return "MOPAC AUX"; } |
| 34 |
std::string description() const override { return "MOPAC AUX file format."; } |
| 35 |
|
| 36 |
std::string specificationUrl() const override |
| 37 |
{ |
| 38 |
return "https://openmopac.net/Manual/auxiliary.html"; |
| 39 |
} |
| 40 |
|
| 41 |
std::vector<std::string> fileExtensions() const override; |
| 42 |
std::vector<std::string> mimeTypes() const override; |
| 43 |
|
| 44 |
[[nodiscard]] bool read(std::istream& in, Core::Molecule& molecule) override; |
| 45 |
[[nodiscard]] bool write(std::ostream&, const Core::Molecule&) override |
| 46 |
{ |
| 47 |
// Empty, as we do not write out MOPAC AUX files. |
| 48 |
return false; |
| 49 |
} |
| 50 |
|
| 51 |
private: |
| 52 |
void processLine(std::istream& in); |
| 53 |
void load(Core::SlaterSet* basis); |
| 54 |
std::vector<int> readArrayElements(std::istream& in, unsigned int n); |
| 55 |
std::vector<int> readArrayI(std::istream& in, unsigned int n); |
| 56 |
std::vector<double> readArrayD(std::istream& in, unsigned int n); |
| 57 |
std::vector<int> readArraySym(std::istream& in, unsigned int n); |
| 58 |
std::vector<Vector3> readArrayVec(std::istream& in, unsigned int n); |
| 59 |
bool readOverlapMatrix(std::istream& in, unsigned int n); |
| 60 |
bool readEigenVectors(std::istream& in, unsigned int n); |
| 61 |
bool readDensityMatrix(std::istream& in, unsigned int n); |
| 62 |
bool readVibrationFrequencies(std::istream& in, unsigned int n); |
| 63 |
bool readVibrationIntensities(std::istream& in, unsigned int n); |
| 64 |
bool readNormalModes(std::istream& in, unsigned int n); |
| 65 |
|
| 66 |
int m_electrons; |
| 67 |
int m_charge = 0; |
| 68 |
int m_spin = 1; |
| 69 |
Vector3 m_dipoleMoment = Vector3::Zero(); |
| 70 |
std::vector<double> m_partialCharges; |
| 71 |
double m_heatOfFormation; |
| 72 |
double m_area; |
| 73 |
double m_volume; |
| 74 |
|
| 75 |
std::vector<double> m_energies; |
| 76 |
std::vector<double> m_forces; |
| 77 |
|
| 78 |
std::vector<int> m_shellTypes; |
| 79 |
std::vector<int> m_shellNums; |
| 80 |
std::vector<int> m_shelltoAtom; |
| 81 |
std::vector<double> m_c; |
| 82 |
std::vector<double> m_csp; |
| 83 |
std::vector<double> m_orbitalEnergy; |
| 84 |
std::vector<double> m_MOcoeffs; |
| 85 |
|
| 86 |
std::vector<int> m_atomIndex; |
| 87 |
std::vector<int> m_atomSym; |
| 88 |
std::vector<int> m_atomNums; |
| 89 |
std::vector<double> m_zeta; |
| 90 |
std::vector<int> m_pqn; |
| 91 |
std::vector<Eigen::Vector3d> m_atomPos; |
| 92 |
std::vector<std::vector<Eigen::Vector3d>> m_coordSets; |
| 93 |
|
| 94 |
std::vector<double> m_frequencies; |
| 95 |
std::vector<double> m_irIntensities; |
| 96 |
std::vector<Eigen::Vector3d> m_normalModes; |
| 97 |
|
| 98 |
Eigen::MatrixXd m_overlap; /// Overlap matrix |
| 99 |
Eigen::MatrixXd m_eigenVectors; |
| 100 |
Eigen::MatrixXd m_density; /// Total density matrix |
| 101 |
}; |
| 102 |
|
| 103 |
} // End namespace QuantumIO |
| 104 |
} // End namespace Avogadro |
| 105 |
|
| 106 |
#endif |