ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-3.0/src/UseTheForce/ForceField.hpp
(Generate patch)

Comparing branches/new_design/OOPSE-3.0/src/UseTheForce/ForceField.hpp (file contents):
Revision 1735 by tim, Fri Nov 12 17:40:03 2004 UTC vs.
Revision 1786 by tim, Fri Nov 26 02:13:56 2004 UTC

# Line 37 | Line 37
37   #define MK_STR(s) # s
38   #define STR_DEFINE(t, s) t = MK_STR(s)
39  
40 < #include <utilities>
40 > #include <string>
41 > #include <utility>
42  
42 #include "utils/Tuple.hpp"
43 #include "types/ShapeAtomType.hpp"
43   #include "io/basic_ifstrstream.hpp"
44   #include "utils/TypeContainer.hpp"
45 + #include "types/AtomType.hpp"
46 + #include "types/BondType.hpp"
47 + #include "types/BendType.hpp"
48 + #include "types/TorsionType.hpp"
49  
50   namespace oopse {
51  
52   /**
53 < * @class ForceFiled ForceField.hpp ''UseTheForce/ForceField.hpp"
53 > * @class ForceField ForceField.hpp ''UseTheForce/ForceField.hpp"
54   * @brief
55   */
56   class ForceField{
57  
58      public:
59  
60 +        typedef TypeContainer<AtomType, 1> AtomTypeContainer;
61 +        typedef TypeContainer<BondType, 2> BondTypeContainer;
62 +        typedef TypeContainer<BendType, 3> BendTypeContainer;
63 +        typedef TypeContainer<TorsionType, 4> TorsionTypeContainer;
64 +        
65          ForceField();
66  
67 <        virtual ~ForceFields(){}
67 >        virtual ~ForceField(){}
68  
69          void setVariant(const std::string &variant) {
70              hasVariant_ = true;
71              variant_ = variant;
72          }
73 <        virtual void readParams() = 0;  
73 >        
74 >        virtual void parse(const std::string& filename) = 0;  
75  
76          AtomType* getAtomType(const std::string &at);
77          BondType* getBondType(const std::string &at1, const std::string &at2);
# Line 71 | Line 80 | class ForceField{
80          TorsionType* getTorsionType(const std::string &at1, const std::string &at2,
81                                            const std::string &at3, const std::string &at4);
82  
83 +        BondType* getExactBondType(const std::string &at1, const std::string &at2);
84 +        BendType* getExactBendType(const std::string &at1, const std::string &at2,
85 +                                    const std::string &at3);
86 +        TorsionType* getExactTorsionType(const std::string &at1, const std::string &at2,
87 +                                          const std::string &at3, const std::string &at4);
88 +
89 +
90 +        //avoid make virtual function public
91 +        //Herb Sutter and Andrei Alexandrescu, C++ coding Standards, Addision-Wesley
92          virtual double getRcutFromAtomType(AtomType* at);
93  
94          std::string getWildCard() {
# Line 81 | Line 99 | class ForceField{
99              wildCardAtomTypeName_ = wildCard;
100          }
101  
102 <    protected:
102 >
103 >        unsigned int getNAtomType() {
104 >            return atomTypeCont_.size();
105 >        }
106          
107 <        void addAtomType(const std::string &at, AtomType* atomType);
108 <        void addBondType(const std::string &at1, const std::string &at2, BondType* bondType);
109 <        void addBendType(const std::string &at1, const std::string &at2,
107 >        bool addAtomType(const std::string &at, AtomType* atomType);
108 >
109 >        bool addBondType(const std::string &at1, const std::string &at2, BondType* bondType);
110 >
111 >        bool addBendType(const std::string &at1, const std::string &at2,
112                                      const std::string &at3, BendType* bendType);
113 <        void addTorsionType(const std::string &at1, const std::string &at2,
113 >
114 >        bool addTorsionType(const std::string &at1, const std::string &at2,
115                                            const std::string &at3, const std::string &at4, TorsionType* torsionType);
116  
117 +        ifstrstream* openForceFieldFile(const std::string& filename);
118 +
119 +    protected:
120 +
121 +        AtomTypeContainer atomTypeCont_;    
122 +        BondTypeContainer bondTypeCont_;
123 +        BendTypeContainer bendTypeCont_;
124 +        TorsionTypeContainer torsionTypeCont_;
125 +        
126      private:  
127          std::string ffPath_;
95        ifstrstream forceFile_;
128          bool hasVariant_;
129          std::string variant_;
130  
131          std::string wildCardAtomTypeName_;
132  
101        typedef TypeContainer<AtomType, 1> AtomTypeContainer;
102        typedef TypeContainer<BondType, 2> BondTypeContainer;
103        typedef TypeContainer<BendType, 3> BendTypeContainer;
104        typedef TypeContainer<TorsionType, 4> TorsionTypeContainer;
105
106        AtomTypeContainer atomTypeCont_;    
107        BondTypeContainer bondTypeCont_;
108        BendTypeContainer bendTypeCont_;
109        TorsionTypeContainer torsionTypeCont_;
133   };
134  
112 typedef GenericFactory<ForceField> ForceFieldFactory;
135  
136   }//end namespace oopse
137   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines