1 | //
|
---|
2 | // File: MPQC_GaussianBasis_Shell_Impl.cc
|
---|
3 | // Symbol: MPQC.GaussianBasis_Shell-v0.2
|
---|
4 | // Symbol Type: class
|
---|
5 | // Babel Version: 0.10.2
|
---|
6 | // Description: Server-side implementation for MPQC.GaussianBasis_Shell
|
---|
7 | //
|
---|
8 | // WARNING: Automatically generated; only changes within splicers preserved
|
---|
9 | //
|
---|
10 | // babel-version = 0.10.2
|
---|
11 | //
|
---|
12 | #include "MPQC_GaussianBasis_Shell_Impl.hh"
|
---|
13 |
|
---|
14 | // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Shell._includes)
|
---|
15 | // Put additional includes or other arbitrary code here...
|
---|
16 | // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Shell._includes)
|
---|
17 |
|
---|
18 | // user-defined constructor.
|
---|
19 | void MPQC::GaussianBasis_Shell_impl::_ctor() {
|
---|
20 | // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Shell._ctor)
|
---|
21 | // add construction details here
|
---|
22 | // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Shell._ctor)
|
---|
23 | }
|
---|
24 |
|
---|
25 | // user-defined destructor.
|
---|
26 | void MPQC::GaussianBasis_Shell_impl::_dtor() {
|
---|
27 | // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Shell._dtor)
|
---|
28 | // add destruction details here
|
---|
29 | // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Shell._dtor)
|
---|
30 | }
|
---|
31 |
|
---|
32 | // static class initializer.
|
---|
33 | void MPQC::GaussianBasis_Shell_impl::_load() {
|
---|
34 | // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Shell._load)
|
---|
35 | // guaranteed to be called at most once before any other method in this class
|
---|
36 | // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Shell._load)
|
---|
37 | }
|
---|
38 |
|
---|
39 | // user-defined static methods: (none)
|
---|
40 |
|
---|
41 | // user-defined non-static methods:
|
---|
42 | /**
|
---|
43 | * Method: initialize[]
|
---|
44 | */
|
---|
45 | void
|
---|
46 | MPQC::GaussianBasis_Shell_impl::initialize (
|
---|
47 | /* in */ void* scshell )
|
---|
48 | throw ()
|
---|
49 | {
|
---|
50 | // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Shell.initialize)
|
---|
51 |
|
---|
52 | shell_ptr_ = static_cast<GaussianShell*>(scshell);
|
---|
53 | sc_shell_.assign_pointer( shell_ptr_ );
|
---|
54 | if(sc_shell_.null())
|
---|
55 | cout << "Shell: sc::GaussianShell is null" << endl;
|
---|
56 |
|
---|
57 | max_am_ = sc_shell_->max_angular_momentum();
|
---|
58 |
|
---|
59 | // determine angular type
|
---|
60 | int has_pure = 0;
|
---|
61 | int has_cartesian = 0;
|
---|
62 | for(int i=0; i<sc_shell_->ncontraction(); ++i) {
|
---|
63 | if( sc_shell_->is_cartesian(i) )
|
---|
64 | ++has_cartesian;
|
---|
65 | else
|
---|
66 | ++has_pure;
|
---|
67 | }
|
---|
68 | if(has_pure && has_cartesian)
|
---|
69 | angular_type_ = AngularType_MIXED;
|
---|
70 | else if(has_pure)
|
---|
71 | angular_type_ = AngularType_SPHERICAL;
|
---|
72 | else if(has_cartesian)
|
---|
73 | angular_type_ = AngularType_CARTESIAN;
|
---|
74 |
|
---|
75 | // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Shell.initialize)
|
---|
76 | }
|
---|
77 |
|
---|
78 | /**
|
---|
79 | * Get the number of contractions in the shell.
|
---|
80 | * @return Number of contractions.
|
---|
81 | */
|
---|
82 | int64_t
|
---|
83 | MPQC::GaussianBasis_Shell_impl::get_n_contraction ()
|
---|
84 | throw ()
|
---|
85 |
|
---|
86 | {
|
---|
87 | // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Shell.get_n_contraction)
|
---|
88 | return sc_shell_->ncontraction();
|
---|
89 | // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Shell.get_n_contraction)
|
---|
90 | }
|
---|
91 |
|
---|
92 | /**
|
---|
93 | * Get the number of primitives in the shell.
|
---|
94 | * @return Number of primitives.
|
---|
95 | */
|
---|
96 | int64_t
|
---|
97 | MPQC::GaussianBasis_Shell_impl::get_n_primitive ()
|
---|
98 | throw ()
|
---|
99 |
|
---|
100 | {
|
---|
101 | // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Shell.get_n_primitive)
|
---|
102 | return sc_shell_->nprimitive();
|
---|
103 | // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Shell.get_n_primitive)
|
---|
104 | }
|
---|
105 |
|
---|
106 | /**
|
---|
107 | * Get the coefficient for an unnormalized primitive in a contraction.
|
---|
108 | * @param connum Contraction number.
|
---|
109 | * @param expnum Primitive number.
|
---|
110 | * @return The contraction coefficient.
|
---|
111 | */
|
---|
112 | double
|
---|
113 | MPQC::GaussianBasis_Shell_impl::get_contraction_coef (
|
---|
114 | /* in */ int64_t connum,
|
---|
115 | /* in */ int64_t expnum )
|
---|
116 | throw ()
|
---|
117 | {
|
---|
118 | // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Shell.get_contraction_coef)
|
---|
119 | return sc_shell_->coefficient_unnorm(connum,expnum);
|
---|
120 | //return sc_shell_->coefficient_norm(connum,expnum);
|
---|
121 | // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Shell.get_contraction_coef)
|
---|
122 | }
|
---|
123 |
|
---|
124 | /**
|
---|
125 | * Get the exponent for a primitive.
|
---|
126 | * @param expnum The primitive number.
|
---|
127 | * @return The exponent.
|
---|
128 | */
|
---|
129 | double
|
---|
130 | MPQC::GaussianBasis_Shell_impl::get_exponent (
|
---|
131 | /* in */ int64_t expnum )
|
---|
132 | throw ()
|
---|
133 | {
|
---|
134 | // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Shell.get_exponent)
|
---|
135 | return sc_shell_->exponent(expnum);
|
---|
136 | // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Shell.get_exponent)
|
---|
137 | }
|
---|
138 |
|
---|
139 | /**
|
---|
140 | * Get the angular momentum for a single contraction.
|
---|
141 | * @param connum Contraction number.
|
---|
142 | * @return Angular momentum value.
|
---|
143 | */
|
---|
144 | int64_t
|
---|
145 | MPQC::GaussianBasis_Shell_impl::get_angular_momentum (
|
---|
146 | /* in */ int64_t connum )
|
---|
147 | throw ()
|
---|
148 | {
|
---|
149 | // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Shell.get_angular_momentum)
|
---|
150 | return sc_shell_->am(connum);
|
---|
151 | // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Shell.get_angular_momentum)
|
---|
152 | }
|
---|
153 |
|
---|
154 | /**
|
---|
155 | * Get the max angular momentum of any contraction in the shell.
|
---|
156 | * @return Maximum angular momentum value.
|
---|
157 | */
|
---|
158 | int64_t
|
---|
159 | MPQC::GaussianBasis_Shell_impl::get_max_angular_momentum ()
|
---|
160 | throw ()
|
---|
161 |
|
---|
162 | {
|
---|
163 | // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Shell.get_max_angular_momentum)
|
---|
164 | return max_am_;
|
---|
165 | // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Shell.get_max_angular_momentum)
|
---|
166 | }
|
---|
167 |
|
---|
168 | /**
|
---|
169 | * Get the angular type for a single contraction.
|
---|
170 | * @param connum Contraction number.
|
---|
171 | * @return enum AngularType {CARTESIAN,SPHERICAL,MIXED}
|
---|
172 | */
|
---|
173 | ::Chemistry::QC::GaussianBasis::AngularType
|
---|
174 | MPQC::GaussianBasis_Shell_impl::get_contraction_angular_type (
|
---|
175 | /* in */ int64_t connum )
|
---|
176 | throw ()
|
---|
177 | {
|
---|
178 | // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Shell.get_contraction_angular_type)
|
---|
179 |
|
---|
180 | AngularType angular;
|
---|
181 |
|
---|
182 | if(sc_shell_->is_cartesian(connum) )
|
---|
183 | angular = AngularType_CARTESIAN;
|
---|
184 | else
|
---|
185 | angular = AngularType_SPHERICAL;
|
---|
186 |
|
---|
187 | return angular;
|
---|
188 |
|
---|
189 | // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Shell.get_contraction_angular_type)
|
---|
190 | }
|
---|
191 |
|
---|
192 | /**
|
---|
193 | * Get the angular type for the shell.
|
---|
194 | * @return enum AngularType {CARTESIAN,SPHERICAL,MIXED}
|
---|
195 | */
|
---|
196 | ::Chemistry::QC::GaussianBasis::AngularType
|
---|
197 | MPQC::GaussianBasis_Shell_impl::get_angular_type ()
|
---|
198 | throw ()
|
---|
199 |
|
---|
200 | {
|
---|
201 | // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Shell.get_angular_type)
|
---|
202 | return angular_type_;
|
---|
203 | // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Shell.get_angular_type)
|
---|
204 | }
|
---|
205 |
|
---|
206 | /**
|
---|
207 | * Print the shell data.
|
---|
208 | */
|
---|
209 | void
|
---|
210 | MPQC::GaussianBasis_Shell_impl::print_shell ()
|
---|
211 | throw ()
|
---|
212 |
|
---|
213 | {
|
---|
214 | // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Shell.print_shell)
|
---|
215 | std::cout << "\n shell:";
|
---|
216 | std::cout << "\n type: [";
|
---|
217 | for(int icon=0; icon<get_n_contraction(); ++icon)
|
---|
218 | std::cout << " am = " << get_angular_momentum(icon);
|
---|
219 | if( max_am_ > 1 ) {
|
---|
220 | if( angular_type_ == AngularType_CARTESIAN )
|
---|
221 | std::cout << " puream = 0";
|
---|
222 | else if( angular_type_ == AngularType_SPHERICAL )
|
---|
223 | std::cout << " puream = 1";
|
---|
224 | else if( angular_type_ == AngularType_MIXED )
|
---|
225 | std::cerr << " mixed angular types?";
|
---|
226 | }
|
---|
227 | std::cout << "]\n";
|
---|
228 | // {exp coef:<am> ...} = {
|
---|
229 | std::cout << " exp";
|
---|
230 | for(int icon=0; icon<get_n_contraction(); ++icon)
|
---|
231 | std::cout << " coef:" << icon;
|
---|
232 | std::cout << "\n";
|
---|
233 | // <exp> <coef> ...
|
---|
234 | for(int iprim=0; iprim<get_n_primitive(); ++iprim) {
|
---|
235 | std::cout << "\t" << get_exponent(iprim);
|
---|
236 | for(int icon=0; icon<get_n_contraction(); ++icon)
|
---|
237 | std::cout << "\t" << get_contraction_coef(icon, iprim);
|
---|
238 | std::cout << endl;
|
---|
239 | }
|
---|
240 | // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Shell.print_shell)
|
---|
241 | }
|
---|
242 |
|
---|
243 |
|
---|
244 | // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Shell._misc)
|
---|
245 | // Put miscellaneous code here
|
---|
246 | // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Shell._misc)
|
---|
247 |
|
---|