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

Comparing trunk/OOPSE-4/src/types/OplsTorsionType.hpp (file contents):
Revision 1930 by gezelter, Wed Jan 12 22:41:40 2005 UTC vs.
Revision 3175 by gezelter, Mon Jul 16 13:33:10 2007 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 54 | Line 54 | namespace oopse {
54  
55   namespace oopse {
56  
57 < /**
58 < * @class OplsTorsionType OplsTorsionType.hpp "types/OplsTorsionType.hpp"
59 < * @todo documentation
60 < */
61 < class OplsTorsionType : public PolynomialTorsionType{
62 <
63 <    public:
64 <
65 <        OplsTorsionType(double v0, double v1, double v2, double v3) :  PolynomialTorsionType(){
66 <
67 <            //convert OPLS Torsion Type to Polynomial Torsion type
68 <            double c0 = v0 + v2 + 0.5*(v1 + v3);
69 <            double c1 = 0.5 *(3*v3- v1);
70 <            double c2 = -v2;
71 <            double c3 = -2.0* v3;
72 <
73 <            setCoefficient(0, c0);
74 <            setCoefficient(1, c1);
75 <            setCoefficient(2, c2);
76 <            setCoefficient(3, c3);
77 <        }
78 <        
79 <        friend std::ostream& operator <<(std::ostream& os, OplsTorsionType& ott);
80 <
81 <    private:
82 <        
83 <        double v0_;
84 <        double v1_;
85 <        double v2_;
86 <        double v3_;
87 <        
88 < };
89 <
90 < std::ostream& operator <<(std::ostream& os, OplsTorsionType& ott) {
91 <
57 >  /**
58 >   * @class OplsTorsionType OplsTorsionType.hpp "types/OplsTorsionType.hpp"
59 >   * @todo documentation
60 >   */
61 >  class OplsTorsionType : public PolynomialTorsionType{
62 >    
63 >  public:
64 >    
65 >    OplsTorsionType(RealType v0, RealType v1, RealType v2, RealType v3) :  
66 >      PolynomialTorsionType(){
67 >      
68 >      //convert OPLS Torsion Type to Polynomial Torsion type
69 >      RealType c0 = v0 + v2 + 0.5*(v1 + v3);
70 >      RealType c1 = 0.5 *(3*v3- v1);
71 >      RealType c2 = -v2;
72 >      RealType c3 = -2.0* v3;
73 >      
74 >      setCoefficient(0, c0);
75 >      setCoefficient(1, c1);
76 >      setCoefficient(2, c2);
77 >      setCoefficient(3, c3);
78 >    }
79 >    
80 >    friend std::ostream& operator <<(std::ostream& os, OplsTorsionType& ott);
81 >    
82 >  private:
83 >    
84 >    RealType v0_;
85 >    RealType v1_;
86 >    RealType v2_;
87 >    RealType v3_;
88 >    
89 >  };
90 >  
91 >  std::ostream& operator <<(std::ostream& os, OplsTorsionType& ott) {
92 >    
93      os << "This OplsTorsionType has below form:" << std::endl;
94      os << ott.v0_ << " + "
95 <         << ott.v1_ << "/2*(1+cos(Omega))" << " + "
96 <         << ott.v2_ << "/2*(1-cos(2*Omega))" << " + "
97 <         << ott.v3_ << "/2*(1+cos(3*Omega))" << std::endl;
95 >       << ott.v1_ << "/2*(1+cos(Omega))" << " + "
96 >       << ott.v2_ << "/2*(1-cos(2*Omega))" << " + "
97 >       << ott.v3_ << "/2*(1+cos(3*Omega))" << std::endl;
98      return os;
99 < }
100 <
101 <
99 >  }
100 >  
101 >  
102   } //end namespace oopse
103   #endif //TYPES_POLYNOMIALBONDTYPE_HPP
104  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines