source: ThirdParty/mpqc_open/src/lib/chemistry/cca/MPQC_GaussianBasis_Atomic_Impl.cc

Candidate_v1.6.1
Last change on this file 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: 5.7 KB
Line 
1//
2// File: MPQC_GaussianBasis_Atomic_Impl.cc
3// Symbol: MPQC.GaussianBasis_Atomic-v0.2
4// Symbol Type: class
5// Babel Version: 0.10.2
6// Description: Server-side implementation for MPQC.GaussianBasis_Atomic
7//
8// WARNING: Automatically generated; only changes within splicers preserved
9//
10// babel-version = 0.10.2
11//
12#include "MPQC_GaussianBasis_Atomic_Impl.hh"
13
14// DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Atomic._includes)
15// Put additional includes or other arbitrary code here...
16// DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Atomic._includes)
17
18// user-defined constructor.
19void MPQC::GaussianBasis_Atomic_impl::_ctor() {
20 // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Atomic._ctor)
21 // add construction details here
22 // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Atomic._ctor)
23}
24
25// user-defined destructor.
26void MPQC::GaussianBasis_Atomic_impl::_dtor() {
27 // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Atomic._dtor)
28
29 // JPK: problems here
30 //for(int i=0; i<nshell_; ++i)
31 // delete &shell_array_[i];
32 //delete shell_array_;
33
34 // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Atomic._dtor)
35}
36
37// static class initializer.
38void MPQC::GaussianBasis_Atomic_impl::_load() {
39 // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Atomic._load)
40 // guaranteed to be called at most once before any other method in this class
41 // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Atomic._load)
42}
43
44// user-defined static methods: (none)
45
46// user-defined non-static methods:
47/**
48 * Method: initialize[]
49 */
50void
51MPQC::GaussianBasis_Atomic_impl::initialize (
52 /* in */ void* scbasis,
53 /* in */ int32_t atomnum )
54throw ()
55{
56 // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Atomic.initialize)
57
58 atomnum_ = atomnum;
59
60 gbs_ptr_ = static_cast<GaussianBasisSet*>(scbasis);
61 sc_gbs_.assign_pointer( gbs_ptr_ );
62 if(sc_gbs_.null())
63 cout << "Atomic: sc::GaussianBasisSet is null" << endl;
64
65 // create shell array
66 nshell_ = sc_gbs_->nshell_on_center(atomnum_);
67 shell_array_ = new GaussianBasis_Shell[nshell_];
68 for(int i=0; i<nshell_; ++i) {
69 shell_array_[i] = GaussianBasis_Shell::_create();
70 GaussianShell &shell_ref = sc_gbs_->shell(atomnum_,i);
71 shell_array_[i].initialize( &shell_ref );
72 }
73
74 // determine max am
75 max_am_ = 0;
76 int temp_am;
77 for(int i=0; i<nshell_; ++i) {
78 for(int j=0; j<shell_array_[i].get_n_contraction(); ++j) {
79 temp_am = shell_array_[i].get_angular_momentum(j);
80 if( temp_am > max_am_ )
81 max_am_ = temp_am;
82 }
83 }
84
85 // determine angular type
86 int has_pure = 0;
87 int has_cartesian = 0;
88 for(int i=0; i<sc_gbs_->nshell_on_center(atomnum_); ++i) {
89 for(int j=0; j<sc_gbs_->shell(atomnum_,i).ncontraction(); ++j) {
90 if( sc_gbs_->shell(atomnum_,i).is_cartesian(j) )
91 ++has_cartesian;
92 if( sc_gbs_->shell(atomnum_,i).is_pure(j) )
93 ++has_pure;
94 }
95 }
96 if(has_pure && has_cartesian)
97 angular_type_ = AngularType_MIXED;
98 else if(has_pure)
99 angular_type_ = AngularType_SPHERICAL;
100 else if(has_cartesian)
101 angular_type_ = AngularType_CARTESIAN;
102
103 // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Atomic.initialize)
104}
105
106/**
107 * Get the canonical basis set name.
108 * @return Canonical basis set name.
109 */
110::std::string
111MPQC::GaussianBasis_Atomic_impl::get_name ()
112throw ()
113
114{
115 // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Atomic.get_name)
116 return sc_gbs_->name();
117 // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Atomic.get_name)
118}
119
120/**
121 * Get the number of basis functions.
122 * @return Number of basis functions.
123 */
124int64_t
125MPQC::GaussianBasis_Atomic_impl::get_n_basis ()
126throw ()
127
128{
129 // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Atomic.get_n_basis)
130 return sc_gbs_->nbasis_on_center(atomnum_);
131 // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Atomic.get_n_basis)
132}
133
134/**
135 * Get the number of shells.
136 * @return Number of shells.
137 */
138int64_t
139MPQC::GaussianBasis_Atomic_impl::get_n_shell ()
140throw ()
141
142{
143 // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Atomic.get_n_shell)
144 return nshell_;
145 // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Atomic.get_n_shell)
146}
147
148/**
149 * Get the max angular momentum for any shell on the atom.
150 * @return Max angular momentum value.
151 */
152int64_t
153MPQC::GaussianBasis_Atomic_impl::get_max_angular_momentum ()
154throw ()
155
156{
157 // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Atomic.get_max_angular_momentum)
158 return max_am_;
159 // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Atomic.get_max_angular_momentum)
160}
161
162/**
163 * Get the angular type for the atom.
164 * @return enum AngularType {CARTESIAN,SPHERICAL,MIXED}
165 */
166::Chemistry::QC::GaussianBasis::AngularType
167MPQC::GaussianBasis_Atomic_impl::get_angular_type ()
168throw ()
169
170{
171 // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Atomic.get_angular_type)
172 return angular_type_;
173 // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Atomic.get_angular_type)
174}
175
176/**
177 * Get a gaussian shell.
178 * @param shellnum Shell number to return.
179 * @return Shell.
180 */
181::Chemistry::QC::GaussianBasis::Shell
182MPQC::GaussianBasis_Atomic_impl::get_shell (
183 /* in */ int64_t shellnum )
184throw ()
185{
186 // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Atomic.get_shell)
187 return shell_array_[shellnum];
188 // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Atomic.get_shell)
189}
190
191/**
192 * Print the atomic basis data.
193 */
194void
195MPQC::GaussianBasis_Atomic_impl::print_atomic ()
196throw ()
197
198{
199 // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Atomic.print_atomic)
200 std::cout << "\n Atomic basis set:";
201 for( int i=0; i<nshell_; ++i )
202 shell_array_[i].print_shell();
203 // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Atomic.print_atomic)
204}
205
206
207// DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Atomic._misc)
208// Put miscellaneous code here
209// DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Atomic._misc)
210
Note: See TracBrowser for help on using the repository browser.