OpenMD 3.0
Molecular Dynamics in the Open
Loading...
Searching...
No Matches
CharmmTorsionType.hpp
1/*
2 * Copyright (c) 2004-present, The University of Notre Dame. All rights
3 * reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form must reproduce the above copyright notice,
12 * this list of conditions and the following disclaimer in the documentation
13 * and/or other materials provided with the distribution.
14 *
15 * 3. Neither the name of the copyright holder nor the names of its
16 * contributors may be used to endorse or promote products derived from
17 * this software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 *
31 * SUPPORT OPEN SCIENCE! If you use OpenMD or its source code in your
32 * research, please cite the appropriate papers when you publish your
33 * work. Good starting points are:
34 *
35 * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).
36 * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).
37 * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008).
38 * [4] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
39 * [5] Kuang & Gezelter, Mol. Phys., 110, 691-701 (2012).
40 * [6] Lamichhane, Gezelter & Newman, J. Chem. Phys. 141, 134109 (2014).
41 * [7] Lamichhane, Newman & Gezelter, J. Chem. Phys. 141, 134110 (2014).
42 * [8] Bhattarai, Newman & Gezelter, Phys. Rev. B 99, 094106 (2019).
43 */
44
45#ifndef TYPES_CHARMMTORSIONTYPE_HPP
46#define TYPES_CHARMMTORSIONTYPE_HPP
47
48#include <algorithm>
49#include <cassert>
50#include <iostream>
51#include <vector>
52
53#include "math/Polynomial.hpp"
54#include "types/TorsionType.hpp"
55
56namespace OpenMD {
57
59 RealType kchi;
60 int n;
61 RealType delta;
62 };
63
65 public:
66 bool operator()(const CharmmTorsionParameter& p1,
67 const CharmmTorsionParameter& p2) {
68 return p1.n < p2.n;
69 }
70 };
71
72 /**
73 * @class CharmmTorsionType CharmmTorsionType.hpp
74 * "types/CharmmTorsionType.hpp" These torsion types are defined identically
75 * with functional form given in the following paper:
76 *
77 * "A. D. MacKerell, Jr. et al., CHARMM: The energy function and its
78 * parameterization with an overview of the program," in The
79 * Encyclopedia of Computational Chemistry, edited by
80 * P. v. R. Schleyer, et al., volume 1, pages 271–277, John Wiley &
81 * Sons, New York, 1998.
82 *
83 * This torsion potential has the form:
84 *
85 * \f[ V_{\mathrm{torsion}}(\phi) = \sum_n K_n \left( 1 + \cos(n \phi -
86 * \delta_n) \right) \f]
87 *
88 * Notes:
89 *
90 * 1. OpenMD converts internally to Chebyshev polynomials for
91 * computational efficiency.
92 * 2. Coefficients \f$ K_n \f$ are assumed to be in kcal / mol.
93 * 3. Phase angles \f$ \delta_n \f$ are assumed to be in degrees.
94 * 4. Periodicity values \f$ n \f$ are positive integers.
95 *
96 * Internally convert CHARMM torsion functions to two polynomials
97 * based on Chebyshev polynomials in cos(phi):
98 *
99 * \f[ V_{\mathrm{torsion}}(\phi) = \sum_n K_n + \sum_n K_n \cos(\delta_n)
100 * T_n(\cos(\phi)) - \sum_n K_n \sin(\delta_n) U_{n-1}((\cos \phi)) \sin(\phi)
101 * \f]
102 *
103 * This conversion has used the cosine addition formula, and two
104 * identities of Chebyshev polynomials:
105 *
106 * \f[ T_n (\cos \phi) = \cos(n \phi) \f]
107 *
108 * for Chebyshev polynomials of the first type, and:
109 *
110 * \f[ U_{n-1} (\cos \phi) \sin(\phi) = \sin( n \phi ) \f]
111 *
112 * for Chebyshev polynomials of the second type. We're left with a
113 * simpler equation for the torsion potential in terms of only
114 * polynomials of the cosine and an additional sine of the angle:
115 *
116 * \f[ V_{\mathrm{torsion}}(\phi) = C + T(\cos(\phi)) + U(\cos(\phi)) \sin(\phi)
117 * \f] where: \f[ C = \sum_n K_n \f] \f[ T(\cos(\phi)) = \sum_n K_n
118 * \cos(\delta_n) T_n(\cos(\phi)) \f] \f[ U(\cos(\phi)) = \sum_n -K_n
119 * \sin(\delta_n) U_{n-1}(\cos(\phi)) \f]
120 */
122 public:
123 CharmmTorsionType(std::vector<CharmmTorsionParameter>& parameters);
124 virtual void calcForce(RealType cosPhi, RealType& V, RealType& dVdCosPhi);
125
126 private:
129 RealType C_;
130 };
131} // namespace OpenMD
132
133#endif // TYPES_CHARMMTORSIONTYPE_HPP
"types/CharmmTorsionType.hpp" These torsion types are defined identically with functional form given ...
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.