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

Comparing trunk/OOPSE-4/src/types/HarmonicBendType.hpp (file contents):
Revision 2759 by tim, Wed May 17 21:51:42 2006 UTC vs.
Revision 3173 by gezelter, Fri Jul 13 18:10:52 2007 UTC

# Line 58 | Line 58 | namespace oopse {
58     * @todo documentation
59     */
60    class HarmonicBendType : public BendType {
61 <
61 >    
62    public:
63 <
64 <    HarmonicBendType(RealType theta, RealType k) : BendType(theta) , k_(k){
63 >    
64 >    HarmonicBendType(RealType theta, RealType k) : BendType(theta), k_(k) {
65      }
66 <
66 >    
67      void setForceConstant(RealType k) {k_ = k; }
68 <
68 >    
69      RealType getForceConstant() {return k_;}
70 <
70 >    
71      void calcForce(RealType theta, RealType& V, RealType& dVdr) {
72        RealType delta = theta - theta0_;
73 <
73 >      
74        V = 0.5 * k_ * delta * delta;
75        dVdr = k_ * delta;
76      }
77 <                
77 >    
78    private:
79      RealType k_;
80 <
80 >    
81    };
82 <
82 >  
83   }//end namespace oopse
84   #endif //TYPES_HARMONICBENDTYPE_HPP
85  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines