ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/primitives/GhostTorsion.cpp
(Generate patch)

Comparing:
trunk/src/primitives/GhostTorsion.cpp (file contents), Revision 1446 by gezelter, Thu Jun 17 14:48:02 2010 UTC vs.
branches/development/src/primitives/GhostTorsion.cpp (file contents), Revision 1712 by gezelter, Sat May 19 13:30:21 2012 UTC

# Line 36 | Line 36
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).                        
39 > * [4]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010).
40 > * [5]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
41   */
42  
43   #include "primitives/GhostTorsion.hpp"
# Line 47 | Line 48 | namespace OpenMD {
48                               DirectionalAtom* ghostAtom, TorsionType *tt)
49      : Torsion(atom1, atom2, ghostAtom, ghostAtom, tt) {}
50    
51 <  void GhostTorsion::calcForce(RealType& angle) {
51 >  void GhostTorsion::calcForce(RealType& angle, bool doParticlePot) {
52      DirectionalAtom* ghostAtom = static_cast<DirectionalAtom*>(atom3_);    
53      
54      Vector3d pos1 = atom1_->getPos();
# Line 56 | Line 57 | namespace OpenMD {
57      
58      Vector3d r21 = pos1 - pos2;
59      Vector3d r32 = pos2 - pos3;
60 <    Vector3d r43 = ghostAtom->getA().getColumn(2);
60 >    Vector3d r43 = ghostAtom->getA().transpose().getColumn(2);
61      
62      //  Calculate the cross products and distances
63      Vector3d A = cross(r21, r32);
# Line 96 | Line 97 | namespace OpenMD {
97      f3.negate();
98      ghostAtom->addTrq(cross(r43, f3));    
99      
100 <    atom1_->addParticlePot(potential_);
101 <    atom2_->addParticlePot(potential_);
102 <    ghostAtom->addParticlePot(potential_);
100 >    if (doParticlePot) {
101 >      atom1_->addParticlePot(potential_);
102 >      atom2_->addParticlePot(potential_);
103 >      ghostAtom->addParticlePot(potential_);
104 >    }
105  
106      angle = acos(cos_phi) /M_PI * 180.0;
107    }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines