| 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_ORCA_H |
| 7 |
#define AVOGADRO_QUANTUMIO_ORCA_H |
| 8 |
|
| 9 |
#include "avogadroquantumioexport.h" |
| 10 |
#include <avogadro/core/array.h> |
| 11 |
#include <avogadro/core/gaussianset.h> |
| 12 |
#include <avogadro/io/fileformat.h> |
| 13 |
|
| 14 |
#include <map> |
| 15 |
#include <vector> |
| 16 |
|
| 17 |
namespace Avogadro { |
| 18 |
namespace QuantumIO { |
| 19 |
|
| 20 |
class AVOGADROQUANTUMIO_EXPORT ORCAOutput : public Io::FileFormat |
| 21 |
{ |
| 22 |
public: |
| 23 |
ORCAOutput(); |
| 24 |
~ORCAOutput() override; |
| 25 |
|
| 26 |
Operations supportedOperations() const override |
| 27 |
{ |
| 28 |
return Read | File | Stream | String; |
| 29 |
} |
| 30 |
|
| 31 |
FileFormat* newInstance() const override { return new ORCAOutput; } |
| 32 |
std::string identifier() const override { return "Avogadro: Orca"; } |
| 33 |
std::string name() const override { return "Orca"; } |
| 34 |
std::string description() const override { return "Orca output format."; } |
| 35 |
|
| 36 |
std::string specificationUrl() const override { return ""; } |
| 37 |
|
| 38 |
std::vector<std::string> fileExtensions() const override; |
| 39 |
std::vector<std::string> mimeTypes() const override; |
| 40 |
|
| 41 |
[[nodiscard]] bool read(std::istream& in, Core::Molecule& molecule) override; |
| 42 |
[[nodiscard]] bool write(std::ostream&, const Core::Molecule&) override |
| 43 |
{ |
| 44 |
// Empty, as we do not write out Orca output files. |
| 45 |
return false; |
| 46 |
} |
| 47 |
|
| 48 |
private: |
| 49 |
void outputAll(); |
| 50 |
|
| 51 |
void processLine(std::istream& in, Core::GaussianSet* basis); |
| 52 |
void load(Core::GaussianSet* basis); |
| 53 |
void clearBasisFunctions(); |
| 54 |
|
| 55 |
void parseMCD(); |
| 56 |
|
| 57 |
// OrcaStuff |
| 58 |
void orcaWarningMessage(const std::string& m); |
| 59 |
Core::GaussianSet::orbital orbitalIdx(std::string txt); |
| 60 |
bool m_orcaSuccess; |
| 61 |
|
| 62 |
std::vector<std::string> m_atomLabel; |
| 63 |
std::vector<std::string> m_basisAtomLabel; |
| 64 |
|
| 65 |
std::vector<int> m_atomNums; |
| 66 |
std::vector<Eigen::Vector3d> m_atomPos; |
| 67 |
std::vector<std::vector<Eigen::Vector3d>> m_coordSets; |
| 68 |
std::vector<double> m_energies; |
| 69 |
|
| 70 |
Vector3 m_dipoleMoment = Vector3::Zero(); |
| 71 |
|
| 72 |
std::vector<std::vector<int>> m_bondOrders; |
| 73 |
|
| 74 |
std::vector<int> shellFunctions; |
| 75 |
std::vector<Core::GaussianSet::orbital> shellTypes; |
| 76 |
std::vector<std::vector<int>> m_orcaNumShells; |
| 77 |
std::vector<std::vector<Core::GaussianSet::orbital>> m_orcaShellTypes; |
| 78 |
int m_nGroups; |
| 79 |
|
| 80 |
std::vector<std::vector<std::vector<Eigen::Vector2d>*>*> m_basisFunctions; |
| 81 |
|
| 82 |
enum mode |
| 83 |
{ |
| 84 |
Atoms, |
| 85 |
GTO, |
| 86 |
MO, |
| 87 |
OrbitalEnergies, |
| 88 |
Charges, |
| 89 |
HirshfeldCharges, |
| 90 |
Frequencies, |
| 91 |
VibrationalModes, |
| 92 |
IR, |
| 93 |
Raman, |
| 94 |
VCD, // vibrational circular dichroism |
| 95 |
Electronic, |
| 96 |
ECD, // electronic circular dichroism |
| 97 |
MCD, // magnetic circular dichroism |
| 98 |
NMR, |
| 99 |
BondOrders, |
| 100 |
NotParsing, |
| 101 |
Unrecognized |
| 102 |
}; |
| 103 |
|
| 104 |
double m_coordFactor; |
| 105 |
mode m_currentMode; |
| 106 |
int m_electrons; |
| 107 |
|
| 108 |
bool m_openShell; |
| 109 |
bool m_readBeta; |
| 110 |
|
| 111 |
int m_homo; |
| 112 |
int m_charge; |
| 113 |
int m_spin; |
| 114 |
double m_totalEnergy; |
| 115 |
|
| 116 |
int m_currentAtom; |
| 117 |
unsigned int m_numBasisFunctions; |
| 118 |
std::vector<Core::GaussianSet::orbital> m_shellTypes; |
| 119 |
std::vector<int> m_shellNums; |
| 120 |
std::vector<int> m_shelltoAtom; |
| 121 |
std::vector<double> m_a; |
| 122 |
std::vector<double> m_c; |
| 123 |
std::vector<double> m_csp; |
| 124 |
std::vector<double> m_orbitalEnergy; |
| 125 |
std::vector<double> m_MOcoeffs; |
| 126 |
std::vector<double> m_betaOrbitalEnergy; |
| 127 |
std::vector<double> m_BetaMOcoeffs; |
| 128 |
|
| 129 |
std::string m_chargeType; |
| 130 |
std::map<std::string, MatrixX> m_partialCharges; |
| 131 |
|
| 132 |
Core::Array<double> m_frequencies; |
| 133 |
Core::Array<double> m_IRintensities; |
| 134 |
Core::Array<double> m_RamanIntensities; |
| 135 |
Core::Array<double> m_vcdIntensities; |
| 136 |
Core::Array<Core::Array<Vector3>> m_vibDisplacements; |
| 137 |
|
| 138 |
Core::Array<double> m_electronicTransitions; // in eV |
| 139 |
Core::Array<double> m_electronicIntensities; |
| 140 |
Core::Array<double> m_electronicRotations; // for CD |
| 141 |
|
| 142 |
Core::Array<double> m_magneticTransitions; // in cm^-1 |
| 143 |
Core::Array<double> m_magneticCD; // for MCD |
| 144 |
|
| 145 |
Core::Array<double> m_nmrShifts; // for NMR (in ppm) |
| 146 |
}; |
| 147 |
|
| 148 |
} // namespace QuantumIO |
| 149 |
} // namespace Avogadro |
| 150 |
|
| 151 |
#endif |