1 |
|
---|
2 | /* simple.h -- definition of the simple internal coordinate classes
|
---|
3 | *
|
---|
4 | * THIS SOFTWARE FITS THE DESCRIPTION IN THE U.S. COPYRIGHT ACT OF A
|
---|
5 | * "UNITED STATES GOVERNMENT WORK". IT WAS WRITTEN AS A PART OF THE
|
---|
6 | * AUTHOR'S OFFICIAL DUTIES AS A GOVERNMENT EMPLOYEE. THIS MEANS IT
|
---|
7 | * CANNOT BE COPYRIGHTED. THIS SOFTWARE IS FREELY AVAILABLE TO THE
|
---|
8 | * PUBLIC FOR USE WITHOUT A COPYRIGHT NOTICE, AND THERE ARE NO
|
---|
9 | * RESTRICTIONS ON ITS USE, NOW OR SUBSEQUENTLY.
|
---|
10 | *
|
---|
11 | * Author:
|
---|
12 | * E. T. Seidl
|
---|
13 | * Bldg. 12A, Rm. 2033
|
---|
14 | * Computer Systems Laboratory
|
---|
15 | * Division of Computer Research and Technology
|
---|
16 | * National Institutes of Health
|
---|
17 | * Bethesda, Maryland 20892
|
---|
18 | * Internet: seidl@alw.nih.gov
|
---|
19 | * February, 1993
|
---|
20 | */
|
---|
21 |
|
---|
22 | #ifndef _intco_simple_h
|
---|
23 | #define _intco_simple_h
|
---|
24 |
|
---|
25 | #ifdef __GNUC__
|
---|
26 | #pragma interface
|
---|
27 | #endif
|
---|
28 |
|
---|
29 |
|
---|
30 | #include <iostream>
|
---|
31 |
|
---|
32 | #include <util/class/class.h>
|
---|
33 | #include <util/state/state.h>
|
---|
34 | #include <util/keyval/keyval.h>
|
---|
35 | #include <chemistry/molecule/molecule.h>
|
---|
36 | #include <chemistry/molecule/coor.h>
|
---|
37 |
|
---|
38 | #include <math/scmat/vector3.h>
|
---|
39 |
|
---|
40 | namespace sc {
|
---|
41 |
|
---|
42 | // ////////////////////////////////////////////////////////////////////////
|
---|
43 |
|
---|
44 | /**
|
---|
45 | The SimpleCo abstract class describes a simple internal coordinate
|
---|
46 | of a molecule. The number atoms involved can be 2, 3 or 4 and is
|
---|
47 | determined by the specialization of SimpleCo.
|
---|
48 |
|
---|
49 | There are three ways to specify the atoms involved in the internal
|
---|
50 | coordinate. The first way is a shorthand notation, just a vector of a
|
---|
51 | label followed by the atom numbers (starting at 1) is given. For example,
|
---|
52 | a stretch between two atoms, 1 and 2, is given, in the
|
---|
53 | ParsedKeyVal format, as
|
---|
54 | <pre>
|
---|
55 | stretch<StreSimpleCo>: [ R12 1 2 ]
|
---|
56 | </pre>
|
---|
57 |
|
---|
58 | The other two ways to specify the atoms are more general. With them, it is
|
---|
59 | possible to give parameters for the IntCoor base class (and thus
|
---|
60 | give the value of the coordinate). In the first of these input formats, a
|
---|
61 | vector associated with the keyword atoms gives the atom numbers.
|
---|
62 | The following specification for stretch is equivalent to that
|
---|
63 | above:
|
---|
64 | <pre>
|
---|
65 | stretch<StreSimpleCo>:( label = R12 atoms = [ 1 2 ] )
|
---|
66 | </pre>
|
---|
67 |
|
---|
68 | In the second, a vector, atom_labels, is given along with a
|
---|
69 | Molecule object. The atom labels are looked up in the
|
---|
70 | Molecule object to find the atom numbers.
|
---|
71 | The following specification for stretch is equivalent to those
|
---|
72 | above:
|
---|
73 | <pre>
|
---|
74 | molecule<Molecule>: (
|
---|
75 | { atom_labels atoms geometry } = {
|
---|
76 | H1 H [ 1.0 0.0 0.0 ]
|
---|
77 | H2 H [-1.0 0.0 0.0 ] } )
|
---|
78 | stretch<StreSimpleCo>:( label = R12
|
---|
79 | atom_labels = [ H1 H2 ]
|
---|
80 | molecule = $:molecule )
|
---|
81 | </pre>
|
---|
82 | */
|
---|
83 | class SimpleCo : public IntCoor {
|
---|
84 | protected:
|
---|
85 | int natoms_;
|
---|
86 | int *atoms;
|
---|
87 |
|
---|
88 | public:
|
---|
89 | SimpleCo();
|
---|
90 | /** This constructor takes an integer argument which is the number of
|
---|
91 | atoms needed to describe the coordinate. A second optional char*
|
---|
92 | argument is a label for the coordinate. This argument is passed on to
|
---|
93 | the IntCoor constructor. */
|
---|
94 | SimpleCo(int,const char* =0);
|
---|
95 | /// The KeyVal constructor requires the number of atoms.
|
---|
96 | SimpleCo(const Ref<KeyVal>&,int natom);
|
---|
97 |
|
---|
98 | virtual ~SimpleCo();
|
---|
99 |
|
---|
100 | /// Returns the number of atoms in the coordinate.
|
---|
101 | int natoms() const;
|
---|
102 | /// Returns the index of the i'th atom in the coordinate.
|
---|
103 | int operator[](int i) const;
|
---|
104 |
|
---|
105 | void save_data_state(StateOut&);
|
---|
106 | SimpleCo(StateIn&);
|
---|
107 |
|
---|
108 | virtual int operator==(SimpleCo&);
|
---|
109 | int operator!=(SimpleCo&u);
|
---|
110 |
|
---|
111 | // these IntCoor members are implemented in term of
|
---|
112 | // the calc_force_con and calc_intco members.
|
---|
113 | /// Returns an approximate force constant (a la Almlof).
|
---|
114 | double force_constant(Ref<Molecule>&);
|
---|
115 | /** Recalculates the value of the coordinate based on the geometry
|
---|
116 | in the Molecule. */
|
---|
117 | void update_value(const Ref<Molecule>&);
|
---|
118 | /// Fill in a row of the B matrix.
|
---|
119 | void bmat(const Ref<Molecule>&,RefSCVector&bmat,double coef = 1.0);
|
---|
120 |
|
---|
121 | /// Calculates an approximate force constant and returns it's value.
|
---|
122 | virtual double calc_force_con(Molecule&) = 0;
|
---|
123 | /** Calculate the value of the coordinate based on what's in Molecule.
|
---|
124 | If given a double*, fill in that part of the B matrix. If the
|
---|
125 | bmatrix is to be calculated, the third argument gives the
|
---|
126 | coefficient. */
|
---|
127 | virtual double calc_intco(Molecule&, double* =0, double =1) = 0;
|
---|
128 |
|
---|
129 | /// Print the coordinate.
|
---|
130 | void print_details(const Ref<Molecule> &,
|
---|
131 | std::ostream& = ExEnv::out0()) const;
|
---|
132 |
|
---|
133 | /** Tests to see if two coordinates are equivalent to each other.
|
---|
134 | This is false if the atoms don't match. */
|
---|
135 | int equivalent(Ref<IntCoor>&);
|
---|
136 | };
|
---|
137 |
|
---|
138 |
|
---|
139 |
|
---|
140 | // ///////////////////////////////////////////////////////////////////////
|
---|
141 |
|
---|
142 | #define SimpleCo_DECLARE(classname) \
|
---|
143 | public: \
|
---|
144 | virtual classname& operator=(const classname&); \
|
---|
145 | SimpleCo& operator=(const SimpleCo&); \
|
---|
146 | double calc_force_con(Molecule&); \
|
---|
147 | double calc_intco(Molecule&, double* =0, double =1); \
|
---|
148 | classname(StateIn&); \
|
---|
149 | void save_data_state(StateOut&)
|
---|
150 |
|
---|
151 | #define SimpleCo_IMPL_eq(classname) \
|
---|
152 | SimpleCo& classname::operator=(const SimpleCo& c) \
|
---|
153 | { \
|
---|
154 | classname *cp = dynamic_cast<classname*>((SimpleCo*)&c); \
|
---|
155 | if(cp) { \
|
---|
156 | *this=*cp; \
|
---|
157 | } \
|
---|
158 | else { \
|
---|
159 | natoms_ = 0; \
|
---|
160 | atoms = 0; \
|
---|
161 | } \
|
---|
162 | \
|
---|
163 | return *this; \
|
---|
164 | }
|
---|
165 |
|
---|
166 | #define SimpleCo_IMPL_StateIn(classname) \
|
---|
167 | classname::classname(StateIn&si): \
|
---|
168 | SimpleCo(si) \
|
---|
169 | { \
|
---|
170 | }
|
---|
171 |
|
---|
172 | #define SimpleCo_IMPL_save_data_state(classname) \
|
---|
173 | void classname::save_data_state(StateOut&so) \
|
---|
174 | { \
|
---|
175 | SimpleCo::save_data_state(so); \
|
---|
176 | }
|
---|
177 |
|
---|
178 | #define SimpleCo_IMPL(classname) \
|
---|
179 | SimpleCo_IMPL_eq(classname) \
|
---|
180 | SimpleCo_IMPL_StateIn(classname) \
|
---|
181 | SimpleCo_IMPL_save_data_state(classname)
|
---|
182 |
|
---|
183 | // ///////////////////////////////////////////////////////////////////////
|
---|
184 |
|
---|
185 | /**
|
---|
186 | The StreSimpleCo class describes an stretch internal coordinate of a
|
---|
187 | molecule. The input is described in the documentation of its parent
|
---|
188 | class SimpleCo.
|
---|
189 |
|
---|
190 | Designating the two atoms as \f$a\f$ and \f$b\f$ and their cartesian
|
---|
191 | positions as \f$\bar{r}_a\f$ and \f$\bar{r}_b\f$, the value of the
|
---|
192 | coordinate, \f$r\f$, is \f[ r = \| \bar{r}_a - \bar{r}_b \| \f] */
|
---|
193 | class StreSimpleCo : public SimpleCo {
|
---|
194 | SimpleCo_DECLARE(StreSimpleCo);
|
---|
195 | public:
|
---|
196 | StreSimpleCo();
|
---|
197 | StreSimpleCo(const StreSimpleCo&);
|
---|
198 | /** This constructor takes a string containing a label, and two integers
|
---|
199 | which are the indices of the atoms we're measuring the distance between.
|
---|
200 | Atom numbering begins at atom 1, not atom 0. */
|
---|
201 | StreSimpleCo(const char*, int, int);
|
---|
202 | /** The KeyVal constructor. This calls the SimpleCo keyval constructor
|
---|
203 | with an integer argument of 2. */
|
---|
204 | StreSimpleCo(const Ref<KeyVal>&);
|
---|
205 |
|
---|
206 | ~StreSimpleCo();
|
---|
207 |
|
---|
208 | /// Always returns the string "STRE".
|
---|
209 | const char * ctype() const;
|
---|
210 |
|
---|
211 | /// Returns the distance between the two atoms in atomic units.
|
---|
212 | double bohr() const;
|
---|
213 | /// Returns the distance between the two atoms in angstrom units.
|
---|
214 | double angstrom() const;
|
---|
215 | /// Returns the distance between the two atoms in angstrom units.
|
---|
216 | double preferred_value() const;
|
---|
217 | };
|
---|
218 |
|
---|
219 | typedef StreSimpleCo Stre;
|
---|
220 |
|
---|
221 | // ///////////////////////////////////////////////////////////////////////
|
---|
222 |
|
---|
223 | static const double rtd = 180.0/M_PI;
|
---|
224 |
|
---|
225 | /** The BendSimpleCo class describes an bend internal coordinate of a
|
---|
226 | molecule. The input is described in the documentation of its parent class
|
---|
227 | SimpleCo.
|
---|
228 |
|
---|
229 | Designating the three atoms as \f$a\f$, \f$b\f$, and \f$c\f$ and their
|
---|
230 | cartesian positions as \f$\bar{r}_a\f$, \f$\bar{r}_b\f$, and
|
---|
231 | \f$\bar{r}_c\f$, the value of the coordinate, \f$\theta\f$, is given by
|
---|
232 |
|
---|
233 | \f[ \bar{u}_{ab} = \frac{\bar{r}_a - \bar{r}_b}{\| \bar{r}_a - \bar{r}_b \|}\f]
|
---|
234 | \f[ \bar{u}_{cb} = \frac{\bar{r}_c - \bar{r}_b}{\| \bar{r}_c - \bar{r}_b \|}\f]
|
---|
235 | \f[ \theta = \arccos ( \bar{u}_{ab} \cdot \bar{u}_{cb} ) \f]
|
---|
236 |
|
---|
237 | */
|
---|
238 | class BendSimpleCo : public SimpleCo {
|
---|
239 | SimpleCo_DECLARE(BendSimpleCo);
|
---|
240 | public:
|
---|
241 | BendSimpleCo();
|
---|
242 | BendSimpleCo(const BendSimpleCo&);
|
---|
243 | /** This constructor takes a string containing a label, and three
|
---|
244 | integers a, b, and c which give the indices of the atoms involved in
|
---|
245 | the angle abc. Atom numbering begins at atom 1, not atom 0. */
|
---|
246 | BendSimpleCo(const char*, int, int, int);
|
---|
247 | /** The KeyVal constructor. This calls the SimpleCo keyval constructor
|
---|
248 | with an integer argument of 3. */
|
---|
249 | BendSimpleCo(const Ref<KeyVal>&);
|
---|
250 |
|
---|
251 | ~BendSimpleCo();
|
---|
252 |
|
---|
253 | /// Always returns the string "BEND".
|
---|
254 | const char * ctype() const;
|
---|
255 |
|
---|
256 | /// Returns the value of the angle abc in radians.
|
---|
257 | double radians() const;
|
---|
258 | /// Returns the value of the angle abc in degrees.
|
---|
259 | double degrees() const;
|
---|
260 | /// Returns the value of the angle abc in degrees.
|
---|
261 | double preferred_value() const;
|
---|
262 | };
|
---|
263 |
|
---|
264 | typedef BendSimpleCo Bend;
|
---|
265 |
|
---|
266 | // ///////////////////////////////////////////////////////////////////////
|
---|
267 |
|
---|
268 | /**
|
---|
269 |
|
---|
270 | The TorsSimpleCo class describes an torsion internal coordinate of a
|
---|
271 | molecule. The input is described in the documentation of its parent
|
---|
272 | class SimpleCo.
|
---|
273 |
|
---|
274 | Designating the four atoms as \f$a\f$, \f$b\f$, \f$c\f$, and \f$d\f$ and
|
---|
275 | their cartesian positions as \f$\bar{r}_a\f$, \f$\bar{r}_b\f$,
|
---|
276 | \f$\bar{r}_c\f$, and \f$\bar{r}_d\f$, the value of the coordinate,
|
---|
277 | \f$\tau\f$, is given by
|
---|
278 |
|
---|
279 | \f[ \bar{u}_{ab} = \frac{\bar{r}_a - \bar{r}_b}{\| \bar{r}_a - \bar{r}_b \|}\f]
|
---|
280 | \f[ \bar{u}_{cb} = \frac{\bar{r}_c - \bar{r}_b}{\| \bar{r}_c - \bar{r}_b \|}\f]
|
---|
281 | \f[ \bar{u}_{cd} = \frac{\bar{r}_c - \bar{r}_d}{\| \bar{r}_c - \bar{r}_b \|}\f]
|
---|
282 | \f[ \bar{n}_{abc}= \frac{\bar{u}_{ab} \times \bar{u}_{cb}}
|
---|
283 | {\| \bar{u}_{ab} \times \bar{u}_{cb} \|} \f]
|
---|
284 | \f[ \bar{n}_{bcd}= \frac{\bar{u}_{cd} \times \bar{u}_{bc}}
|
---|
285 | {\| \bar{u}_{cd} \times \bar{u}_{bc} \|} \f]
|
---|
286 | \f[ s = \left\{
|
---|
287 | \begin{array}{ll}
|
---|
288 | 1 & \mbox{if $(\bar{n}_{abc}\times\bar{n}_{bcd}) \cdot \bar{u}_{cb}
|
---|
289 | > 0;$} \\
|
---|
290 | -1 & \mbox{otherwise}
|
---|
291 | \end{array} \right.
|
---|
292 | \f]
|
---|
293 | \f[ \tau = s \arccos ( - \bar{n}_{abc} \cdot \bar{n}_{bcd} ) \f]
|
---|
294 |
|
---|
295 | */
|
---|
296 | class TorsSimpleCo : public SimpleCo {
|
---|
297 | SimpleCo_DECLARE(TorsSimpleCo);
|
---|
298 | public:
|
---|
299 | TorsSimpleCo();
|
---|
300 | TorsSimpleCo(const TorsSimpleCo&);
|
---|
301 | /** This constructor takes a string containing a label, and four
|
---|
302 | integers a, b, c, and d which give the indices of the atoms involved in
|
---|
303 | the torsion angle abcd. Atom numbering begins at atom 1, not atom 0. */
|
---|
304 | TorsSimpleCo(const char *refr, int, int, int, int);
|
---|
305 | /** The KeyVal constructor. This calls the
|
---|
306 | SimpleCo keyval constructor with an integer argument of 4. */
|
---|
307 | TorsSimpleCo(const Ref<KeyVal>&);
|
---|
308 |
|
---|
309 | ~TorsSimpleCo();
|
---|
310 |
|
---|
311 | /// Always returns the string "TORS".
|
---|
312 | const char * ctype() const;
|
---|
313 |
|
---|
314 | /// Returns the value of the angle abc in radians.
|
---|
315 | double radians() const;
|
---|
316 | /// Returns the value of the angle abc in degrees.
|
---|
317 | double degrees() const;
|
---|
318 | /// Returns the value of the angle abc in degrees.
|
---|
319 | double preferred_value() const;
|
---|
320 | };
|
---|
321 |
|
---|
322 | typedef TorsSimpleCo Tors;
|
---|
323 |
|
---|
324 | // ///////////////////////////////////////////////////////////////////////
|
---|
325 |
|
---|
326 | /**
|
---|
327 | The ScaledTorsSimpleCo class describes an scaled torsion internal
|
---|
328 | coordinate of a molecule. The scaled torsion is more stable that ordinary
|
---|
329 | torsions (see the TorsSimpleCo class) in describing situations
|
---|
330 | where one of the torsions plane's is given by three near linear atoms.
|
---|
331 |
|
---|
332 | Designating the four atoms as \f$a\f$, \f$b\f$, \f$c\f$, and \f$d\f$ and
|
---|
333 | their cartesian positions as \f$\bar{r}_a\f$, \f$\bar{r}_b\f$,
|
---|
334 | \f$\bar{r}_c\f$, and \f$\bar{r}_d\f$, the value of the coordinate,
|
---|
335 | \f$\tau_s\f$, is given by
|
---|
336 |
|
---|
337 | \f[ \bar{u}_{ab} = \frac{\bar{r}_a - \bar{r}_b}{\| \bar{r}_a - \bar{r}_b \|}\f]
|
---|
338 | \f[ \bar{u}_{cb} = \frac{\bar{r}_c - \bar{r}_b}{\| \bar{r}_c - \bar{r}_b \|}\f]
|
---|
339 | \f[ \bar{u}_{cd} = \frac{\bar{r}_c - \bar{r}_d}{\| \bar{r}_c - \bar{r}_b \|}\f]
|
---|
340 | \f[ \bar{n}_{abc}= \frac{\bar{u}_{ab} \times \bar{u}_{cb}}
|
---|
341 | {\| \bar{u}_{ab} \times \bar{u}_{cb} \|}\f]
|
---|
342 | \f[ \bar{n}_{bcd}= \frac{\bar{u}_{cd} \times \bar{u}_{cb}}
|
---|
343 | {\| \bar{u}_{cd} \times \bar{u}_{cb} \|}\f]
|
---|
344 | \f[ s = \left\{
|
---|
345 | \begin{array}{ll}
|
---|
346 | -1 & \mbox{if $(\bar{n}_{abc}\times\bar{n}_{bcd})
|
---|
347 | \cdot \bar{u}_{cb} > 0$} \\
|
---|
348 | 1 & \mbox{otherwise}
|
---|
349 | \end{array}
|
---|
350 | \right.
|
---|
351 | \f]
|
---|
352 | \f[ \tau_s = s \sqrt{\left(1-(\bar{u}_{ab} \cdot \bar{u}_{cb}\right)^2)
|
---|
353 | \left(1-(\bar{u}_{cb} \cdot \bar{u}_{cd}\right)^2)}
|
---|
354 | \arccos ( - \bar{n}_{abc} \cdot \bar{n}_{bcd} )\f]
|
---|
355 |
|
---|
356 | */
|
---|
357 | class ScaledTorsSimpleCo : public SimpleCo {
|
---|
358 | SimpleCo_DECLARE(ScaledTorsSimpleCo);
|
---|
359 | private:
|
---|
360 | double old_torsion_;
|
---|
361 | public:
|
---|
362 | ScaledTorsSimpleCo();
|
---|
363 | ScaledTorsSimpleCo(const ScaledTorsSimpleCo&);
|
---|
364 | /** This constructor takes a string containing a label, and four
|
---|
365 | integers a, b, c, and d which give the indices of the atoms involved in
|
---|
366 | the torsion angle abcd. Atom numbering begins at atom 1, not atom 0. */
|
---|
367 | ScaledTorsSimpleCo(const char *refr, int, int, int, int);
|
---|
368 | /** The KeyVal constructor. This calls the
|
---|
369 | SimpleCo keyval constructor with an integer argument of 4. */
|
---|
370 | ScaledTorsSimpleCo(const Ref<KeyVal>&);
|
---|
371 |
|
---|
372 | ~ScaledTorsSimpleCo();
|
---|
373 |
|
---|
374 | /// Always returns the string "TORS".
|
---|
375 | const char * ctype() const;
|
---|
376 |
|
---|
377 | /// Returns the value of the angle abc in radians.
|
---|
378 | double radians() const;
|
---|
379 | /// Returns the value of the angle abc in degrees.
|
---|
380 | double degrees() const;
|
---|
381 | /// Returns the value of the angle abc in degrees.
|
---|
382 | double preferred_value() const;
|
---|
383 | };
|
---|
384 |
|
---|
385 | typedef ScaledTorsSimpleCo ScaledTors;
|
---|
386 |
|
---|
387 | // ///////////////////////////////////////////////////////////////////////
|
---|
388 |
|
---|
389 | /*
|
---|
390 | The OutSimpleCo class describes an out-of-plane internal coordinate
|
---|
391 | of a molecule. The input is described in the documentation of its parent
|
---|
392 | class SimpleCo.
|
---|
393 |
|
---|
394 | Designating the four atoms as \f$a\f$, \f$b\f$, \f$c\f$, and \f$d\f$ and
|
---|
395 | their cartesian positions as \f$\bar{r}_a\f$, \f$\bar{r}_b\f$,
|
---|
396 | \f$\bar{r}_c\f$, and \f$\bar{r}_d\f$, the value of the coordinate,
|
---|
397 | \f$\tau\f$, is given by
|
---|
398 |
|
---|
399 | \f[ \bar{u}_{ab} = \frac{\bar{r}_a - \bar{r}_b}{\| \bar{r}_a - \bar{r}_b \|}\f]
|
---|
400 | \f[ \bar{u}_{cb} = \frac{\bar{r}_b - \bar{r}_c}{\| \bar{r}_c - \bar{r}_b \|}\f]
|
---|
401 | \f[ \bar{u}_{db} = \frac{\bar{r}_c - \bar{r}_d}{\| \bar{r}_c - \bar{r}_b \|}\f]
|
---|
402 | \f[ \bar{n}_{bcd}= \frac{\bar{u}_{cb} \times \bar{u}_{db}}
|
---|
403 | {\| \bar{u}_{cb} \times \bar{u}_{db} \|}\f]
|
---|
404 | \f[ \phi = \arcsin ( \bar{u}_{ab} \cdot \bar{n}_{bcd} )\f]
|
---|
405 |
|
---|
406 | */
|
---|
407 | class OutSimpleCo : public SimpleCo {
|
---|
408 | SimpleCo_DECLARE(OutSimpleCo);
|
---|
409 | public:
|
---|
410 | OutSimpleCo();
|
---|
411 | OutSimpleCo(const OutSimpleCo&);
|
---|
412 | /** This constructor takes a string containing a label, and four
|
---|
413 | integers a, b, c, and d which give the indices of the atoms involved in
|
---|
414 | the out-of-plane angle abcd. Atom numbering begins at atom 1, not
|
---|
415 | atom 0. */
|
---|
416 | OutSimpleCo(const char *refr, int, int, int, int);
|
---|
417 | /** The KeyVal constructor. This calls the SimpleCo keyval
|
---|
418 | constructor with an integer argument of 4. */
|
---|
419 | OutSimpleCo(const Ref<KeyVal>&);
|
---|
420 |
|
---|
421 | ~OutSimpleCo();
|
---|
422 |
|
---|
423 | /// Always returns the string "OUT".
|
---|
424 | const char * ctype() const;
|
---|
425 |
|
---|
426 | /// Returns the value of the angle abc in radians.
|
---|
427 | double radians() const;
|
---|
428 | /// Returns the value of the angle abc in degrees.
|
---|
429 | double degrees() const;
|
---|
430 | /// Returns the value of the angle abc in degrees.
|
---|
431 | double preferred_value() const;
|
---|
432 | };
|
---|
433 |
|
---|
434 | typedef OutSimpleCo Out;
|
---|
435 |
|
---|
436 | // ///////////////////////////////////////////////////////////////////////
|
---|
437 |
|
---|
438 | /** The LinIPSimpleCo class describes an in-plane component of a linear
|
---|
439 | bend internal coordinate of a molecule. The input is described in the
|
---|
440 | documentation of its parent class SimpleCo. A vector, \f$\bar{u}\f$, given
|
---|
441 | as the keyword u, that is not colinear with either \f$\bar{r}_a -
|
---|
442 | \bar{r}_b\f$ or \f$\bar{r}_b - \bar{r}_c\f$ must be provided, where
|
---|
443 | \f$\bar{r}_a\f$, \f$\bar{r}_b\f$, and \f$\bar{r}_c\f$ are the positions of
|
---|
444 | the first, second, and third atoms, respectively.
|
---|
445 |
|
---|
446 | Usually, LinIPSimpleCo is used with a corresponding LinOPSimpleCo, which
|
---|
447 | is given exactly the same u.
|
---|
448 |
|
---|
449 | Designating the three atoms as \f$a\f$, \f$b\f$, and \f$c\f$ and their
|
---|
450 | cartesian positions as \f$\bar{r}_a\f$, \f$\bar{r}_b\f$, and
|
---|
451 | \f$\bar{r}_c\f$, the value of the coordinate, \f$\theta_i\f$, is given by
|
---|
452 |
|
---|
453 | \f[ \bar{u}_{ab} = \frac{\bar{r}_a - \bar{r}_b}{\| \bar{r}_a - \bar{r}_b \|}\f]
|
---|
454 | \f[ \bar{u}_{cb} = \frac{\bar{r}_b - \bar{r}_c}{\| \bar{r}_c - \bar{r}_b \|}\f]
|
---|
455 | \f[ \theta_i = \pi - \arccos ( \bar{u}_{ab} \cdot \bar{u} )
|
---|
456 | - \arccos ( \bar{u}_{cb} \cdot \bar{u} )\f]
|
---|
457 |
|
---|
458 | */
|
---|
459 | class LinIPSimpleCo : public SimpleCo {
|
---|
460 | SimpleCo_DECLARE(LinIPSimpleCo);
|
---|
461 | private:
|
---|
462 | SCVector3 u2;
|
---|
463 | public:
|
---|
464 | LinIPSimpleCo();
|
---|
465 | LinIPSimpleCo(const LinIPSimpleCo&);
|
---|
466 | /** This constructor takes a string containing a label, and three
|
---|
467 | integers a, b, and d which give the indices of the atoms involved in
|
---|
468 | the linear angle abc. The last argument, u, is a unit vector
|
---|
469 | used to defined the direction in which distortion is measured.
|
---|
470 | Atom numbering begins at atom 1, not atom 0. */
|
---|
471 | LinIPSimpleCo(const char *refr, int, int, int, const SCVector3 &u);
|
---|
472 | /** The KeyVal constructor. This calls the SimpleCo keyval
|
---|
473 | constructor with an integer argument of 3. */
|
---|
474 | LinIPSimpleCo(const Ref<KeyVal>&);
|
---|
475 |
|
---|
476 | ~LinIPSimpleCo();
|
---|
477 |
|
---|
478 | /// Always returns the string "LINIP".
|
---|
479 | const char * ctype() const;
|
---|
480 |
|
---|
481 | /// Returns the value of the angle abc in radians.
|
---|
482 | double radians() const;
|
---|
483 | /// Returns the value of the angle abc in degrees.
|
---|
484 | double degrees() const;
|
---|
485 | /// Returns the value of the angle abc in degrees.
|
---|
486 | double preferred_value() const;
|
---|
487 | };
|
---|
488 |
|
---|
489 | typedef LinIPSimpleCo LinIP;
|
---|
490 |
|
---|
491 | // ///////////////////////////////////////////////////////////////////////
|
---|
492 |
|
---|
493 | /** The LinOPSimpleCo class describes an out-of-plane component of a linear
|
---|
494 | bend internal coordinate of a molecule. The input is described in the
|
---|
495 | documentation of its parent class SimpleCo. A vector, \f$\bar{u}\f$, given
|
---|
496 | as the keyword u, that is not colinear with either \f$\bar{r}_a -
|
---|
497 | \bar{r}_b\f$ or \f$\bar{r}_b - \bar{r}_c\f$ must be provided, where
|
---|
498 | \f$\bar{r}_a\f$, \f$\bar{r}_b\f$, and \f$\bar{r}_c\f$ are the positions of
|
---|
499 | the first, second, and third atoms, respectively.
|
---|
500 |
|
---|
501 | Usually, LinOPSimpleCo is used with a corresponding LinIPSimpleCo, which
|
---|
502 | is given exactly the same u.
|
---|
503 |
|
---|
504 | Designating the three atoms as \f$a\f$, \f$b\f$, and \f$c\f$ and their
|
---|
505 | cartesian positions as \f$\bar{r}_a\f$, \f$\bar{r}_b\f$, and
|
---|
506 | \f$\bar{r}_c\f$, the value of the coordinate, \f$\theta_o\f$, is given by
|
---|
507 |
|
---|
508 |
|
---|
509 | \f[ \bar{u}_{ab} = \frac{\bar{r}_a - \bar{r}_b}{\| \bar{r}_a - \bar{r}_b \|}\f]
|
---|
510 | \f[ \bar{u}_{cb} = \frac{\bar{r}_b - \bar{r}_c}{\| \bar{r}_c - \bar{r}_b \|}\f]
|
---|
511 | \f[ \bar{n} = \frac{\bar{u} \times \bar{u}_{ab}}
|
---|
512 | {\| \bar{u} \times \bar{u}_{ab} \|}\f]
|
---|
513 | \f[ \theta_o = \pi - \arccos ( \bar{u}_{ab} \cdot \bar{n} )
|
---|
514 | - \arccos ( \bar{u}_{cb} \cdot \bar{n} )\f]
|
---|
515 |
|
---|
516 | */
|
---|
517 | class LinOPSimpleCo : public SimpleCo {
|
---|
518 | SimpleCo_DECLARE(LinOPSimpleCo);
|
---|
519 | private:
|
---|
520 | SCVector3 u2;
|
---|
521 | public:
|
---|
522 | LinOPSimpleCo();
|
---|
523 | LinOPSimpleCo(const LinOPSimpleCo&);
|
---|
524 | /** This constructor takes a string containing a label, and three
|
---|
525 | integers a, b, and c which give the indices of the atoms involved in
|
---|
526 | the linear angle abc. The last argument, u, is a unit vector used to
|
---|
527 | defined the direction perpendicular to the direction in which
|
---|
528 | distortion is measured. Atom numbering begins at atom 1, not atom 0. */
|
---|
529 | LinOPSimpleCo(const char *refr, int, int, int, const SCVector3 &u);
|
---|
530 | /** The KeyVal constructor. This calls the
|
---|
531 | SimpleCo keyval constructor with an integer argument of 3. */
|
---|
532 | LinOPSimpleCo(const Ref<KeyVal>&);
|
---|
533 |
|
---|
534 | ~LinOPSimpleCo();
|
---|
535 |
|
---|
536 | /// Always returns the string "LINIP".
|
---|
537 | const char * ctype() const;
|
---|
538 |
|
---|
539 | /// Returns the value of the angle abc in radians.
|
---|
540 | double radians() const;
|
---|
541 | /// Returns the value of the angle abc in degrees.
|
---|
542 | double degrees() const;
|
---|
543 | /// Returns the value of the angle abc in degrees.
|
---|
544 | double preferred_value() const;
|
---|
545 | };
|
---|
546 |
|
---|
547 | typedef LinOPSimpleCo LinOP;
|
---|
548 |
|
---|
549 | }
|
---|
550 |
|
---|
551 | #endif /* _intco_simple_h */
|
---|
552 |
|
---|
553 | // Local Variables:
|
---|
554 | // mode: c++
|
---|
555 | // c-file-style: "CLJ"
|
---|
556 | // End:
|
---|