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

« back to all changes in this revision

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

  • 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:
71
71
    )
72
72
  )
73
73
</pre>
74
 
The default units are Bohr with can be overridden with
75
 
#unit=angstrom#.  The #atom_labels# array can be
76
 
omitted.  The #atoms# and #geometry# arrays
 
74
The default units are Bohr which can be overridden with
 
75
<tt>unit=angstrom</tt>.  The <tt>atom_labels</tt> array can be
 
76
omitted.  The <tt>atoms</tt> and <tt>geometry</tt> arrays
77
77
are required.
78
78
 
 
79
As a special case, an atom can be given with the symbol <tt>Q</tt> or the
 
80
name <tt>charge</tt>.  Such centers are treated as point charges and not
 
81
given basis functions.  The values of the charges must be specified with a
 
82
<tt>charge</tt> vector in the Molecule input.  Since the charge vector
 
83
assign charges to all centers, including atoms, it is easiest to place all
 
84
point charge centers first in the geometry, and then give a charge vector
 
85
with a number of elements equal to the number of point charges.  The
 
86
following example shows a water molecule interacting with a point charge
 
87
having value 0.1:
 
88
<pre>
 
89
molecule<Molecule>: (
 
90
    unit=angstrom
 
91
    charge = [ 0.1 ]
 
92
    { atom_labels atoms           geometry            } = {
 
93
          Q1         Q   [ 0.0         0 10.0         ]
 
94
          O1         O   [ 0.000000000 0  0.369372944 ]
 
95
          H1         H   [ 0.783975899 0 -0.184686472 ]
 
96
          H2         H   [-0.783975899 0 -0.184686472 ]
 
97
     }
 
98
    )
 
99
  )
 
100
</pre>
 
101
 
 
102
This feature is designed for doing QM/MM calculations, so, by default,
 
103
methods will not include interactions between the <tt>Q</tt> centers when
 
104
computing the energy or the gradient.  To include these interactions, set
 
105
<tt>include_qq=1</tt>.
 
106
 
79
107
The Molecule class has a PointGroup
80
108
member object, which also has a KeyVal constructor
81
109
that is called when a Molecule is made.  The
119
147
    double *mass_;
120
148
    char **labels_;
121
149
 
 
150
    // The Z that represents a "Q" type atom.
 
151
    int q_Z_;
 
152
 
 
153
    // If true, include the q terms in the charge and efield routines
 
154
    bool include_q_;
 
155
 
 
156
    // If true, include the coupling between q-q pairs when
 
157
    // computing nuclear repulsion energy and gradients.
 
158
    bool include_qq_;
 
159
 
 
160
    // These vectors contain the atom indices of atoms that are not type
 
161
    // "Q" and those that are.
 
162
    std::vector<int> q_atoms_;
 
163
    std::vector<int> non_q_atoms_;
 
164
 
122
165
    void clear();
123
166
  public:
124
167
    Molecule();
272
315
    /// Return the maximum atomic number.
273
316
    int max_z();
274
317
 
275
 
    /// Return the molecules AtomInfo object.
 
318
    /// Return the molecule's AtomInfo object.
276
319
    Ref<AtomInfo> atominfo() const { return atominfo_; }
277
320
 
 
321
    /// Returns the element name of the atom.
 
322
    std::string atom_name(int iatom) const;
 
323
 
 
324
    /// Returns the element symbol of the atom.
 
325
    std::string atom_symbol(int iatom) const;
 
326
 
 
327
    /** If include_q is true, then include the "Q" atoms in the charge and
 
328
        efield routines. */
 
329
    void set_include_q(bool iq) { include_q_ = iq; }
 
330
    /// Returns include_q.  See set_include_q.
 
331
    bool include_q() const { return include_q_; }
 
332
 
 
333
    /** If include_qq is true, include the coupling between pairs of "Q"
 
334
        atoms when computing nuclear repulsion energy and gradients. */
 
335
    void set_include_qq(bool iqq) { include_qq_ = iqq; }
 
336
    /// Returns include_qq.  See set_include_qq.
 
337
    bool include_qq() const { return include_qq_; }
 
338
 
 
339
    /// Retrieve the number of "Q" atoms.
 
340
    int n_q_atom() const { return q_atoms_.size(); }
 
341
    /// Retrieve the "Q" atoms.
 
342
    int q_atom(int i) const { return q_atoms_[i]; }
 
343
 
 
344
    /// Retrieve the number of non-"Q" atoms.
 
345
    int n_non_q_atom() const { return non_q_atoms_.size(); }
 
346
    /// Retrieve the of non-"Q" atoms.
 
347
    int non_q_atom(int i) const { return non_q_atoms_[i]; }
 
348
 
278
349
    void save_data_state(StateOut&);
279
350
};
280
351