-
Notifications
You must be signed in to change notification settings - Fork 0
/
CGTOShell.hh
110 lines (96 loc) · 3.27 KB
/
CGTOShell.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#ifndef SHELL_HH
#define SHELL_HH
/*!
* \file CGTOShell.hh
* \brief Definition of the CGTOShell class
*/
#include <Eigen/Core>
// Forward declaration
class Basis;
class CGTOShell
{
public:
/*!
* \brief Constructor
*
* Create a new shell for contracted Gaussian type orbitals with total
* angular momentum \a lsum, consisting of primitive Gaussians defined
* by \a weights and \a widths, located on center \a center.
* \param index The index of this shell in the CGTOShellList
* \param lsum The total angular momentum of this shell
* \param weights The weights of the primitives in the contraction
* \param widths The widths of the primitives
* \param ipos Position ID of the orbital's center
* \param center The orbital center
*/
CGTOShell(int index, int lsum, const Eigen::ArrayXd& weights,
const Eigen::ArrayXd& widths, int ipos,
const Eigen::Vector3d& center):
_index(index), _lsum(lsum), _weights(weights), _widths(widths),
_ipos(ipos), _center(center) { scaleWeights(); }
//! Return the number of primitive widths in this shell
int size() const { return _widths.size(); }
//! Return this shell's index in the CGTOShellList
int index() const { return _index; }
//! Return the total angular momentum of the shell
int lsum() const { return _lsum; }
//! Return the weight of the \a i'th primitive
double weight(int i) const { return _weights[i]; }
//! Return the weights of all primitives in this shell
const Eigen::ArrayXd& weights() const { return _weights; }
//! Return the width of the \a i'th primitive
double width(int i) const { return _widths[i]; }
//! Return the widths of all primitives in this shell
const Eigen::ArrayXd& widths() const { return _widths; }
//! Return the position ID of this shell's center
int positionId() const { return _ipos; }
//! Return the center position of this shell
const Eigen::Vector3d& center() const { return _center; }
//! Return the \a i coordinate of the center of this shell
double center(int i) const { return _center[i]; }
/*!
* \brief Expand this shell
*
* Expand this shell, adding all functions in it to the basis.
* \param basis The basis being constructed
*/
void expand(Basis& basis) const;
/*!
* \brief Print this CGTOShell
*
* Write a textual representation of this shell to output stream \a os.
* \param os The output stream to write to
* \return The updated output stream
*/
std::ostream& print(std::ostream& os) const;
private:
//! Index of this shell in the CGTOShellList
int _index;
//! The total angular momentum of the shell
int _lsum;
//! The widths of the primitive Gaussians
Eigen::ArrayXd _weights;
//! The widths of the primitive Gaussians
Eigen::ArrayXd _widths;
//! Position identifier of the center
int _ipos;
//! The center position of this function
Eigen::Vector3d _center;
//! Scale the weights of the primitives as a first step in normalization
void scaleWeights();
};
namespace {
/*!
* \brief Print a shell
*
* Write a textual representation of CGTO shell \a shell to output stream \a os.
* \param os The output stream to write to
* \param shell The shell to print
* \return The updated output stream
*/
inline std::ostream& operator<<(std::ostream& os, const CGTOShell& shell)
{
return shell.print(os);
}
} // namespace
#endif // SHELL_HH