source: ThirdParty/mpqc_open/src/lib/chemistry/cca/MPQC_GaussianBasis_Shell_Impl.cc@ 7516f6

Action_Thermostats Adding_MD_integration_tests Adding_StructOpt_integration_tests AutomationFragmentation_failures Candidate_v1.6.1 ChemicalSpaceEvaluator Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Exclude_Hydrogens_annealWithBondGraph Fix_Verbose_Codepatterns ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion Gui_displays_atomic_force_velocity JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool PythonUI_with_named_parameters Recreated_GuiChecks StoppableMakroAction TremoloParser_IncreasedPrecision
Last change on this file since 7516f6 was 860145, checked in by Frederik Heber <heber@…>, 8 years ago

Merge commit '0b990dfaa8c6007a996d030163a25f7f5fc8a7e7' as 'ThirdParty/mpqc_open'

  • Property mode set to 100644
File size: 7.1 KB
Line 
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.
19void 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.
26void 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.
33void 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 */
45void
46MPQC::GaussianBasis_Shell_impl::initialize (
47 /* in */ void* scshell )
48throw ()
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 */
82int64_t
83MPQC::GaussianBasis_Shell_impl::get_n_contraction ()
84throw ()
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 */
96int64_t
97MPQC::GaussianBasis_Shell_impl::get_n_primitive ()
98throw ()
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 */
112double
113MPQC::GaussianBasis_Shell_impl::get_contraction_coef (
114 /* in */ int64_t connum,
115 /* in */ int64_t expnum )
116throw ()
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 */
129double
130MPQC::GaussianBasis_Shell_impl::get_exponent (
131 /* in */ int64_t expnum )
132throw ()
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 */
144int64_t
145MPQC::GaussianBasis_Shell_impl::get_angular_momentum (
146 /* in */ int64_t connum )
147throw ()
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 */
158int64_t
159MPQC::GaussianBasis_Shell_impl::get_max_angular_momentum ()
160throw ()
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
174MPQC::GaussianBasis_Shell_impl::get_contraction_angular_type (
175 /* in */ int64_t connum )
176throw ()
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
197MPQC::GaussianBasis_Shell_impl::get_angular_type ()
198throw ()
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 */
209void
210MPQC::GaussianBasis_Shell_impl::print_shell ()
211throw ()
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
Note: See TracBrowser for help on using the repository browser.