| 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_CORE_SLATERSETTOOLS_H |
| 7 |
#define AVOGADRO_CORE_SLATERSETTOOLS_H |
| 8 |
|
| 9 |
#include "avogadrocoreexport.h" |
| 10 |
|
| 11 |
#include "vector.h" |
| 12 |
|
| 13 |
#include <vector> |
| 14 |
|
| 15 |
namespace Avogadro::Core { |
| 16 |
|
| 17 |
class Molecule; |
| 18 |
class SlaterSet; |
| 19 |
|
| 20 |
/** |
| 21 |
* @class SlaterSetTools slatersettools.h <avogadro/core/slatersettools.h> |
| 22 |
* @brief Provide tools to calculate molecular orbitals, electron densities and |
| 23 |
* other derived data stored in a GaussianSet result. |
| 24 |
* @author Marcus D. Hanwell |
| 25 |
*/ |
| 26 |
|
| 27 |
class AVOGADROCORE_EXPORT SlaterSetTools |
| 28 |
{ |
| 29 |
public: |
| 30 |
explicit SlaterSetTools(Molecule* mol = nullptr); |
| 31 |
~SlaterSetTools() = default; |
| 32 |
|
| 33 |
/** |
| 34 |
* @brief Calculate the value of the specified molecular orbital at the |
| 35 |
* position specified. |
| 36 |
* @param position The position in space to calculate the value. |
| 37 |
* @param molecularOrbitalNumber The molecular orbital number. |
| 38 |
* @return The value of the molecular orbital at the position specified. |
| 39 |
*/ |
| 40 |
double calculateMolecularOrbital(const Vector3& position, |
| 41 |
int molecularOrbitalNumber) const; |
| 42 |
|
| 43 |
/** |
| 44 |
* @brief Calculate the value of the electron density at the position |
| 45 |
* specified. |
| 46 |
* @param position The position in space to calculate the value. |
| 47 |
* @return The value of the electron density at the position specified. |
| 48 |
*/ |
| 49 |
double calculateElectronDensity(const Vector3& position) const; |
| 50 |
|
| 51 |
/** |
| 52 |
* @brief Calculate the value of the electron spin density at the position |
| 53 |
* specified. |
| 54 |
* @param position The position in space to calculate the value. |
| 55 |
* @return The value of the spin density at the position specified. |
| 56 |
*/ |
| 57 |
double calculateSpinDensity(const Vector3& position) const; |
| 58 |
|
| 59 |
/** |
| 60 |
* @brief Check that the basis set is valid and can be used. |
| 61 |
* @return True if valid, false otherwise. |
| 62 |
*/ |
| 63 |
bool isValid() const; |
| 64 |
|
| 65 |
private: |
| 66 |
Molecule* m_molecule; |
| 67 |
SlaterSet* m_basis; |
| 68 |
|
| 69 |
bool isSmall(double value) const; |
| 70 |
|
| 71 |
/** |
| 72 |
* @brief Calculate the values at this position in space. The public calculate |
| 73 |
* functions call this function to prepare values before multiplying by the |
| 74 |
* molecular orbital or density matrix elements. |
| 75 |
* @param position The position in space to calculate the value. |
| 76 |
*/ |
| 77 |
std::vector<double> calculateValues(const Vector3& position) const; |
| 78 |
}; |
| 79 |
|
| 80 |
} // namespace Avogadro::Core |
| 81 |
|
| 82 |
#endif // AVOGADRO_CORE_SlaterSetTools_H |