ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/primitives/Bend.cpp
(Generate patch)

Comparing trunk/OOPSE-4/src/primitives/Bend.cpp (file contents):
Revision 1930 by gezelter, Wed Jan 12 22:41:40 2005 UTC vs.
Revision 2204 by gezelter, Fri Apr 15 22:04:00 2005 UTC

# Line 1 | Line 1
1 < /*
1 > /*
2   * Copyright (c) 2005 The University of Notre Dame. All Rights Reserved.
3   *
4   * The University of Notre Dame grants you ("Licensee") a
# Line 43 | Line 43 | namespace oopse {
43  
44   namespace oopse {
45  
46 < /**@todo still a lot left to improve*/
47 < void Bend::calcForce() {
46 >  /**@todo still a lot left to improve*/
47 >  void Bend::calcForce() {
48      Vector3d pos1 = atom1_->getPos();
49      Vector3d pos2 = atom2_->getPos();
50      Vector3d pos3 = atom3_->getPos();
# Line 63 | Line 63 | void Bend::calcForce() {
63  
64      //check roundoff    
65      if (cosTheta > 1.0) {
66 <        cosTheta = 1.0;
66 >      cosTheta = 1.0;
67      } else if (cosTheta < -1.0) {
68 <        cosTheta = -1.0;
68 >      cosTheta = -1.0;
69      }
70  
71      double theta = acos(cosTheta);
# Line 77 | Line 77 | void Bend::calcForce() {
77      double sinTheta = sqrt(1.0 - cosTheta * cosTheta);
78  
79      if (fabs(sinTheta) < 1.0E-6) {
80 <        sinTheta = 1.0E-6;
80 >      sinTheta = 1.0E-6;
81      }
82  
83      double commonFactor1 = dVdTheta / sinTheta * d21inv;
# Line 93 | Line 93 | void Bend::calcForce() {
93      atom1_->addFrc(force1);
94      atom2_->addFrc(force2);
95      atom3_->addFrc(force3);
96 < }
96 >  }
97  
98   } //end namespace oopse

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines