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

Comparing trunk/src/primitives/Bend.cpp (file contents):
Revision 246 by gezelter, Wed Jan 12 22:41:40 2005 UTC vs.
Revision 749 by tim, Wed Nov 16 23:10:02 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(double& angle) {
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 73 | Line 73 | void Bend::calcForce() {
73      double dVdTheta;
74  
75      bendType_->calcForce(theta, potential_, dVdTheta);
76 +    //std::cout << atom1_->getType() << "\t" << atom2_->getType() << "\t" << atom3_->getType() << "\t";
77 +    //std::cout << "theta = " << theta/M_PI * 180.0 <<", potential = " << potential_ << std::endl;
78  
79      double sinTheta = sqrt(1.0 - cosTheta * cosTheta);
80  
81      if (fabs(sinTheta) < 1.0E-6) {
82 <        sinTheta = 1.0E-6;
82 >      sinTheta = 1.0E-6;
83      }
84  
85      double commonFactor1 = dVdTheta / sinTheta * d21inv;
# Line 93 | Line 95 | void Bend::calcForce() {
95      atom1_->addFrc(force1);
96      atom2_->addFrc(force2);
97      atom3_->addFrc(force3);
96 }
98  
99 +    angle = theta /M_PI * 180.0;
100 +  }
101 +
102   } //end namespace oopse

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines