source: ThirdParty/mpqc_open/src/lib/chemistry/cca/MPQC_GaussianBasis_Molecular_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: 6.4 KB
Line 
1//
2// File: MPQC_GaussianBasis_Molecular_Impl.cc
3// Symbol: MPQC.GaussianBasis_Molecular-v0.2
4// Symbol Type: class
5// Babel Version: 0.10.2
6// Description: Server-side implementation for MPQC.GaussianBasis_Molecular
7//
8// WARNING: Automatically generated; only changes within splicers preserved
9//
10// babel-version = 0.10.2
11//
12#include "MPQC_GaussianBasis_Molecular_Impl.hh"
13
14// DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Molecular._includes)
15#include <chemistry/molecule/molecule.h>
16// DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Molecular._includes)
17
18// user-defined constructor.
19void MPQC::GaussianBasis_Molecular_impl::_ctor() {
20 // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Molecular._ctor)
21 // add construction details here
22 // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Molecular._ctor)
23}
24
25// user-defined destructor.
26void MPQC::GaussianBasis_Molecular_impl::_dtor() {
27 // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Molecular._dtor)
28
29 // JK: problems here
30 //for(int i=0; i<natom_; ++i)
31 // delete &atomic_array_[i];
32 //delete atomic_array_;
33
34 // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Molecular._dtor)
35}
36
37// static class initializer.
38void MPQC::GaussianBasis_Molecular_impl::_load() {
39 // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Molecular._load)
40 // guaranteed to be called at most once before any other method in this class
41 // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Molecular._load)
42}
43
44// user-defined static methods: (none)
45
46// user-defined non-static methods:
47/**
48 * Method: initialize[]
49 */
50void
51MPQC::GaussianBasis_Molecular_impl::initialize (
52 /* in */ void* scbasis,
53 /* in */ const ::std::string& label )
54throw ()
55{
56 // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Molecular.initialize)
57
58 label_ = label;
59
60 gbs_ptr_ = static_cast< GaussianBasisSet* >(scbasis);
61 sc_gbs_.assign_pointer( gbs_ptr_ );
62 if(sc_gbs_.null())
63 cout << "Molecular: sc::GaussianBasisSet is null" << endl;
64
65 // determine angular type
66 int has_pure = 0;
67 int has_cartesian = 0;
68 for(int i=0; i<sc_gbs_->nshell(); ++i) {
69 for(int j=0; j<sc_gbs_->shell(i).ncontraction(); ++j) {
70 if( sc_gbs_->shell(i).is_cartesian(j) )
71 ++has_cartesian;
72 if( sc_gbs_->shell(i).is_pure(j) )
73 ++has_pure;
74 }
75 }
76
77 if(has_pure && has_cartesian)
78 angular_type_ = AngularType_MIXED;
79 else if(has_pure)
80 angular_type_ = AngularType_SPHERICAL;
81 else if(has_cartesian)
82 angular_type_ = AngularType_CARTESIAN;
83
84 // create a CCA molecule
85 Ref<sc::Molecule> scmol = sc_gbs_->molecule();
86 natom_ = scmol->natom();
87 molecule_ = Chemistry_Molecule::_create();
88 molecule_.initialize(natom_, "bohr");
89 for( int i=0; i<natom_; ++i) {
90 molecule_.set_atomic_number(i,scmol->Z(i));
91 for( int j=0; j<3; ++j)
92 molecule_.set_cart_coor( i, j, scmol->r(i,j) );
93 }
94
95 // create array of atomic basis sets
96 atomic_array_ = new MPQC::GaussianBasis_Atomic[sc_gbs_->ncenter()];
97 for( int i=0; i<sc_gbs_->ncenter(); ++i) {
98 atomic_array_[i] = MPQC::GaussianBasis_Atomic::_create();
99 atomic_array_[i].initialize(sc_gbs_.pointer(),i);
100 }
101
102 // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Molecular.initialize)
103}
104
105/**
106 * Method: sc_gbs_pointer[]
107 */
108void*
109MPQC::GaussianBasis_Molecular_impl::sc_gbs_pointer ()
110throw ()
111
112{
113 // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Molecular.sc_gbs_pointer)
114 // insert implementation here
115 // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Molecular.sc_gbs_pointer)
116}
117
118/**
119 * Get the user specified name.
120 * @return User specified name.
121 */
122::std::string
123MPQC::GaussianBasis_Molecular_impl::get_label ()
124throw ()
125
126{
127 // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Molecular.get_label)
128 return label_;
129 // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Molecular.get_label)
130}
131
132/**
133 * Get the number of basis functions.
134 * @return Number of basis functions.
135 */
136int64_t
137MPQC::GaussianBasis_Molecular_impl::get_n_basis ()
138throw ()
139
140{
141 // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Molecular.get_n_basis)
142 return sc_gbs_->nbasis();
143 // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Molecular.get_n_basis)
144}
145
146/**
147 * Get the number of shells.
148 * @return Number of shells.
149 */
150int64_t
151MPQC::GaussianBasis_Molecular_impl::get_n_shell ()
152throw ()
153
154{
155 // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Molecular.get_n_shell)
156 return sc_gbs_->nshell();
157 // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Molecular.get_n_shell)
158}
159
160/**
161 * Get the max angular momentum for any contraction in the basis set.
162 * @return Max angular momentum value.
163 */
164int64_t
165MPQC::GaussianBasis_Molecular_impl::get_max_angular_momentum ()
166throw ()
167
168{
169 // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Molecular.get_max_angular_momentum)
170 return sc_gbs_->max_angular_momentum();
171 // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Molecular.get_max_angular_momentum)
172}
173
174/**
175 * Get the angular type.
176 * @return enum AngularType {CARTESIAN,SPHERICAL,MIXED}
177 */
178::Chemistry::QC::GaussianBasis::AngularType
179MPQC::GaussianBasis_Molecular_impl::get_angular_type ()
180throw ()
181
182{
183 // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Molecular.get_angular_type)
184 return angular_type_;
185 // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Molecular.get_angular_type)
186}
187
188/**
189 * Get an atomic basis set.
190 * @param atomnum Atom number.
191 * @return Atomic basis set.
192 */
193::Chemistry::QC::GaussianBasis::Atomic
194MPQC::GaussianBasis_Molecular_impl::get_atomic (
195 /* in */ int64_t atomnum )
196throw ()
197{
198 // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Molecular.get_atomic)
199 return atomic_array_[atomnum];
200 // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Molecular.get_atomic)
201}
202
203/**
204 * Get the molecule.
205 * @return The molecule.
206 */
207::Chemistry::Molecule
208MPQC::GaussianBasis_Molecular_impl::get_molecule ()
209throw ()
210
211{
212 // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Molecular.get_molecule)
213 return molecule_;
214 // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Molecular.get_molecule)
215}
216
217/**
218 * Print the molecular basis data.
219 */
220void
221MPQC::GaussianBasis_Molecular_impl::print_molecular ()
222throw ()
223
224{
225 // DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Molecular.print_molecular)
226 std::cout << "\nMolecular Basis Set:";
227 for( int i=0; i<natom_; ++i) {
228 atomic_array_[i].print_atomic();
229 }
230 // DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Molecular.print_molecular)
231}
232
233
234// DO-NOT-DELETE splicer.begin(MPQC.GaussianBasis_Molecular._misc)
235// Put miscellaneous code here
236// DO-NOT-DELETE splicer.end(MPQC.GaussianBasis_Molecular._misc)
237
Note: See TracBrowser for help on using the repository browser.