~ubuntu-branches/ubuntu/oneiric/mpqc/oneiric

« back to all changes in this revision

Viewing changes to src/lib/chemistry/cca/MPQC_GaussianBasis_Molecular_Impl.cc

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck
  • Date: 2005-11-27 11:41:49 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051127114149-zgz9r3gk50w8ww2q
Tags: 2.3.0-1
* New upstream release.
* debian/rules (SONAME): Activate awk snippet for automatic so-name
  detection again, resulting in a bump to `7' and making a `c2a' for
  the C++ allocator change unnecessary; closes: #339232.
* debian/patches/00list (08_gcc-4.0_fixes): Removed, no longer needed.
* debian/rules (test): Remove workarounds, do not abort build if tests
  fail.
* debian/ref: Removed.
* debian/control.in (libsc): Added Conflict against libsc6c2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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.
 
19
void 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.
 
26
void 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.
 
38
void 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
 */
 
50
void
 
51
MPQC::GaussianBasis_Molecular_impl::initialize (
 
52
  /* in */ void* scbasis,
 
53
  /* in */ const ::std::string& label ) 
 
54
throw () 
 
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
 */
 
108
void*
 
109
MPQC::GaussianBasis_Molecular_impl::sc_gbs_pointer ()
 
110
throw () 
 
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
 
123
MPQC::GaussianBasis_Molecular_impl::get_label ()
 
124
throw () 
 
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
 */
 
136
int64_t
 
137
MPQC::GaussianBasis_Molecular_impl::get_n_basis ()
 
138
throw () 
 
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
 */
 
150
int64_t
 
151
MPQC::GaussianBasis_Molecular_impl::get_n_shell ()
 
152
throw () 
 
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
 */
 
164
int64_t
 
165
MPQC::GaussianBasis_Molecular_impl::get_max_angular_momentum ()
 
166
throw () 
 
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
 
179
MPQC::GaussianBasis_Molecular_impl::get_angular_type ()
 
180
throw () 
 
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
 
194
MPQC::GaussianBasis_Molecular_impl::get_atomic (
 
195
  /* in */ int64_t atomnum ) 
 
196
throw () 
 
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
 
208
MPQC::GaussianBasis_Molecular_impl::get_molecule ()
 
209
throw () 
 
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
 */
 
220
void
 
221
MPQC::GaussianBasis_Molecular_impl::print_molecular ()
 
222
throw () 
 
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