# | Line 6 | Line 6 | |
---|---|---|
6 | * redistribute this software in source and binary code form, provided | |
7 | * that the following conditions are met: | |
8 | * | |
9 | < | * 1. Acknowledgement of the program authors must be made in any |
10 | < | * publication of scientific results based in part on use of the |
11 | < | * program. An acceptable form of acknowledgement is citation of |
12 | < | * the article in which the program was described (Matthew |
13 | < | * A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher |
14 | < | * J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented |
15 | < | * Parallel Simulation Engine for Molecular Dynamics," |
16 | < | * J. Comput. Chem. 26, pp. 252-271 (2005)) |
17 | < | * |
18 | < | * 2. Redistributions of source code must retain the above copyright |
9 | > | * 1. Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. | |
11 | * | |
12 | < | * 3. Redistributions in binary form must reproduce the above copyright |
12 | > | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the | |
15 | * distribution. | |
# | Line 37 | Line 28 | |
28 | * arising out of the use of or inability to use software, even if the | |
29 | * University of Notre Dame has been advised of the possibility of | |
30 | * such damages. | |
31 | + | * |
32 | + | * SUPPORT OPEN SCIENCE! If you use OpenMD or its source code in your |
33 | + | * research, please cite the appropriate papers when you publish your |
34 | + | * work. Good starting points are: |
35 | + | * |
36 | + | * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). |
37 | + | * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). |
38 | + | * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). |
39 | + | * [4] Vardeman & Gezelter, in progress (2009). |
40 | */ | |
41 | ||
42 | #include "constraints/Rattle.hpp" | |
43 | #include "primitives/Molecule.hpp" | |
44 | #include "utils/simError.h" | |
45 | < | namespace oopse { |
45 | > | namespace OpenMD { |
46 | ||
47 | Rattle::Rattle(SimInfo* info) : info_(info), maxConsIteration_(10), consTolerance_(1.0e-6) { | |
48 | ||
# | Line 160 | Line 160 | namespace oopse { | |
160 | ||
161 | currentSnapshot_->wrapVector(pab); | |
162 | ||
163 | < | double pabsq = pab.lengthSquare(); |
163 | > | RealType pabsq = pab.lengthSquare(); |
164 | ||
165 | < | double rabsq = consPair->getConsDistSquare(); |
166 | < | double diffsq = rabsq - pabsq; |
165 | > | RealType rabsq = consPair->getConsDistSquare(); |
166 | > | RealType diffsq = rabsq - pabsq; |
167 | ||
168 | // the original rattle code from alan tidesley | |
169 | if (fabs(diffsq) > (consTolerance_ * rabsq * 2)){ | |
# | Line 175 | Line 175 | namespace oopse { | |
175 | ||
176 | currentSnapshot_->wrapVector(rab); | |
177 | ||
178 | < | double rpab = dot(rab, pab); |
179 | < | double rpabsq = rpab * rpab; |
178 | > | RealType rpab = dot(rab, pab); |
179 | > | RealType rpabsq = rpab * rpab; |
180 | ||
181 | if (rpabsq < (rabsq * -diffsq)){ | |
182 | return consFail; | |
183 | } | |
184 | ||
185 | < | double rma = 1.0 / consElem1->getMass(); |
186 | < | double rmb = 1.0 / consElem2->getMass(); |
185 | > | RealType rma = 1.0 / consElem1->getMass(); |
186 | > | RealType rmb = 1.0 / consElem2->getMass(); |
187 | ||
188 | < | double gab = diffsq / (2.0 * (rma + rmb) * rpab); |
188 | > | RealType gab = diffsq / (2.0 * (rma + rmb) * rpab); |
189 | ||
190 | Vector3d delta = rab * gab; | |
191 | ||
# | Line 234 | Line 234 | namespace oopse { | |
234 | ||
235 | currentSnapshot_->wrapVector(rab); | |
236 | ||
237 | < | double rma = 1.0 / consElem1->getMass(); |
238 | < | double rmb = 1.0 / consElem2->getMass(); |
237 | > | RealType rma = 1.0 / consElem1->getMass(); |
238 | > | RealType rmb = 1.0 / consElem2->getMass(); |
239 | ||
240 | < | double rvab = dot(rab, dv); |
240 | > | RealType rvab = dot(rab, dv); |
241 | ||
242 | < | double gab = -rvab / ((rma + rmb) * consPair->getConsDistSquare()); |
242 | > | RealType gab = -rvab / ((rma + rmb) * consPair->getConsDistSquare()); |
243 | ||
244 | if (fabs(gab) > consTolerance_){ | |
245 | Vector3d delta = rab * gab; |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |