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

« back to all changes in this revision

Viewing changes to src/lib/chemistry/molecule/molecule.cc

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck
  • Date: 2006-09-10 22:32:33 UTC
  • mfrom: (1.1.3 upstream) (3.1.1 etch)
  • Revision ID: james.westby@ubuntu.com-20060910223233-5dza8qes8de6qbdk
Tags: 2.3.1-1
* New upstream release.
  + Includes updated libtool; closes: #320604.
* debian/control.in (libsc7-dev): Remove superfluous Depends on 
  libc6-dev.
* debian/control.in (libsc7): Remove conflicts with older versions of 
  libsc.
* debian/rules (SO_NAME): Override to 7.

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
  clear_symmetry_info();
108
108
}
109
109
 
 
110
void
 
111
Molecule::throw_if_atom_duplicated(int begin, double tol)
 
112
{
 
113
  for (int i=begin; i<natoms_; i++) {
 
114
      SCVector3 ri(r_[i]);
 
115
      for (int j=0; j<i; j++) {
 
116
          SCVector3 rj(r_[j]);
 
117
          if (ri.dist(rj) < tol) {
 
118
              throw InputError("duplicated atom coordinate",
 
119
                               __FILE__, __LINE__, 0, 0, class_desc());
 
120
            }
 
121
        }
 
122
    }
 
123
}
 
124
 
110
125
Molecule::Molecule(const Ref<KeyVal>&input):
111
126
 natoms_(0), r_(0), Z_(0), charges_(0), mass_(0), labels_(0)
112
127
{
362
377
    }
363
378
 
364
379
  natoms_++;
 
380
 
 
381
  throw_if_atom_duplicated(natoms_-1);
365
382
}
366
383
 
367
384
void
1148
1165
  // evals: principal moments of inertia
1149
1166
  // evecs: principal axes (optional argument)
1150
1167
 
1151
 
  const double au_to_angs = 0.2800283608302436; // for moments of inertia
 
1168
  Ref<Units> units = new Units("angstroms * angstroms");
 
1169
  double au_to_angs = units->from_atomic_units();
1152
1170
 
1153
1171
  double *inert[3];  // inertia tensor
1154
1172