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

Comparing trunk/OOPSE-3.0/src/types/AtomType.hpp (file contents):
Revision 2062 by tim, Fri Feb 25 21:22:00 2005 UTC vs.
Revision 2427 by chuckv, Mon Nov 14 21:29:36 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 52 | Line 52 | namespace oopse {
52   #include "UseTheForce/DarkSide/atype_interface.h"
53  
54   namespace oopse {
55 <    /**
56 <     * @class AtomType
57 <     * AtomType is what OOPSE looks to for unchanging data about an atom.
58 <     * Things that belong to AtomType are universal properties (i.e. does
59 <     * this atom have a Charge?  What is it's mass_?)  Dynamic properties of
60 <     * an atom are not intended to be properties of an atom type
61 <     */
62 <    class AtomType {
63 <        public:
55 >  /**
56 >   * @class AtomType
57 >   * AtomType is what OOPSE looks to for unchanging data about an atom.
58 >   * Things that belong to AtomType are universal properties (i.e. does
59 >   * this atom have a Charge?  What is it's mass_?)  Dynamic properties of
60 >   * an atom are not intended to be properties of an atom type
61 >   */
62 >  class AtomType {
63 >  public:
64  
65 <            AtomType();
65 >    AtomType();
66  
67 <            virtual ~AtomType() { } ;
67 >    virtual ~AtomType() { } ;
68  
69 <            virtual void complete();
69 >    virtual void complete();
70  
71 <            /**
72 <             * Finishes off the AtomType by communicating the logical portions of the
73 <             * structure to the Fortran atype module
74 <             */
75 <            void makeFortranAtomType();
71 >    /**
72 >     * Finishes off the AtomType by communicating the logical portions of the
73 >     * structure to the Fortran atype module
74 >     */
75 >    void makeFortranAtomType();
76              
77 <            void setMass(double m) {
78 <                mass_ = m;
79 <            }
77 >    void setMass(double m) {
78 >      mass_ = m;
79 >    }
80  
81 <            double getMass(void) {
82 <                return mass_;
83 <            }
81 >    double getMass(void) {
82 >      return mass_;
83 >    }
84  
85 <            void setIdent(int id) {
86 <                atp.ident = id;
87 <            }
85 >    void setIdent(int id) {
86 >      atp.ident = id;
87 >    }
88  
89 <            int getIdent() {
90 <                return atp.ident;
91 <            }
89 >    int getIdent() {
90 >      return atp.ident;
91 >    }
92  
93 <            void setName(const std::string&name) {
94 <                name_ = name;
95 <            }
93 >    void setName(const std::string&name) {
94 >      name_ = name;
95 >    }
96  
97 <            std::string getName() {
98 <                return name_;
99 <            }
97 >    std::string getName() {
98 >      return name_;
99 >    }
100  
101 <            void setLennardJones() {
102 <                atp.is_LennardJones = 1;
103 <            }
101 >    void setLennardJones() {
102 >      atp.is_LennardJones = 1;
103 >    }
104  
105 <            bool isLennardJones() {
106 <                return atp.is_LennardJones;
107 <            }
105 >    bool isLennardJones() {
106 >      return atp.is_LennardJones;
107 >    }
108  
109  
110 <            bool isElectrostatic() {
111 <                return isCharge() || isMultipole();
112 <            }
110 >    bool isElectrostatic() {
111 >      return isCharge() || isMultipole();
112 >    }
113  
114 <            void setEAM() {
115 <                atp.is_EAM = 1;
116 <            }
114 >    void setEAM() {
115 >      atp.is_EAM = 1;
116 >    }
117  
118 <            bool isEAM() {
119 <                return atp.is_EAM;
120 <            }
118 >    bool isEAM() {
119 >      return atp.is_EAM;
120 >    }
121  
122 <            void setCharge() {
123 <                atp.is_Charge = 1;
124 <            }
122 >    void setCharge() {
123 >      atp.is_Charge = 1;
124 >    }
125  
126 <            bool isCharge() {
127 <                return atp.is_Charge;
128 <            }
126 >    bool isCharge() {
127 >      return atp.is_Charge;
128 >    }
129  
130 <            bool isDirectional() {
131 <                return atp.is_Directional;
132 <            }
130 >    bool isDirectional() {
131 >      return atp.is_Directional;
132 >    }
133  
134 <            bool isDipole() {
135 <                return atp.is_Dipole;
136 <            }
134 >    bool isDipole() {
135 >      return atp.is_Dipole;
136 >    }
137  
138 <            bool isQuadrupole() {
139 <                return atp.is_Quadrupole;
140 <            }
138 >    bool isSplitDipole() {
139 >      return atp.is_SplitDipole;
140 >    }
141 >
142 >    bool isQuadrupole() {
143 >      return atp.is_Quadrupole;
144 >    }
145              
146 <            bool isMultipole() {
147 <                return isDipole() || isQuadrupole();
148 <            }
146 >    bool isMultipole() {
147 >      return isDipole() || isQuadrupole();
148 >    }
149  
150 <            bool isGayBerne() {
151 <                return atp.is_GayBerne;
152 <            }
150 >    bool isGayBerne() {
151 >      return atp.is_GayBerne;
152 >    }
153  
154 <            bool isSticky() {
155 <                return atp.is_Sticky;
156 <            }
154 >    bool isSticky() {
155 >      return atp.is_Sticky;
156 >    }
157 >    
158 >    bool isStickyPower() {
159 >      return atp.is_StickyPower;
160 >    }
161  
162 <            bool isShape() {
163 <                return atp.is_Shape;
164 <            }
162 >    bool isShape() {
163 >      return atp.is_Shape;
164 >    }
165  
166 <            //below functions are just forward functions
167 <            /**
168 <             * Adds property into property map
169 <             * @param genData GenericData to be added into PropertyMap
170 <             */
171 <            void addProperty(GenericData* genData);
166 >    bool isSC() {
167 >      return atp.is_SC;
168 >    }
169 >    
170 >    void setSC() {
171 >      atp.is_SC = 1;
172 >    }
173 >    
174 >    
175 >    bool isMEAM() {
176 >      return atp.is_MEAM;
177 >    }
178 >    
179 >    void setMEAM() {
180 >      atp.is_MEAM = 1;
181 >    }
182 >    
183 >    
184 >    //below functions are just forward functions
185 >    /**
186 >     * Adds property into property map
187 >     * @param genData GenericData to be added into PropertyMap
188 >     */
189 >    void addProperty(GenericData* genData);
190  
191 <            /**
192 <             * Removes property from PropertyMap by name
193 <             * @param propName the name of property to be removed
194 <             */
195 <            void removeProperty(const std::string& propName);
191 >    /**
192 >     * Removes property from PropertyMap by name
193 >     * @param propName the name of property to be removed
194 >     */
195 >    void removeProperty(const std::string& propName);
196  
197 <            /**
198 <             * clear all of the properties
199 <             */
200 <            void clearProperties();
197 >    /**
198 >     * clear all of the properties
199 >     */
200 >    void clearProperties();
201  
202 <            /**
203 <             * Returns all names of properties
204 <             * @return all names of properties
205 <             */
206 <            std::vector<std::string> getPropertyNames();
202 >    /**
203 >     * Returns all names of properties
204 >     * @return all names of properties
205 >     */
206 >    std::vector<std::string> getPropertyNames();
207  
208 <            /**
209 <             * Returns all of the properties in PropertyMap
210 <             * @return all of the properties in PropertyMap
211 <             */      
212 <            std::vector<GenericData*> getProperties();
208 >    /**
209 >     * Returns all of the properties in PropertyMap
210 >     * @return all of the properties in PropertyMap
211 >     */      
212 >    std::vector<GenericData*> getProperties();
213  
214 <            /**
215 <             * Returns property
216 <             * @param propName name of property
217 <             * @return a pointer point to property with propName. If no property named propName
218 <             * exists, return NULL
219 <             */      
220 <        GenericData* getPropertyByName(const std::string& propName);
214 >    /**
215 >     * Returns property
216 >     * @param propName name of property
217 >     * @return a pointer point to property with propName. If no property named propName
218 >     * exists, return NULL
219 >     */      
220 >    GenericData* getPropertyByName(const std::string& propName);
221  
222 <        protected:
222 >  protected:
223  
224 <            AtomTypeProperties atp;
225 <            double mass_;
226 <            std::string name_;
224 >    AtomTypeProperties atp;
225 >    double mass_;
226 >    std::string name_;
227  
228 <        private:
229 <            //prevent copy construction and copy assignment, since property map contains
230 <            //pointers which can not be copied and managered safely, except make the generic data
231 <            //at PropertyMap as copy on write shared pointer
232 <            AtomType(const AtomType&);
233 <            AtomType& operator=(const AtomType& atomType);
228 >  private:
229 >    //prevent copy construction and copy assignment, since property map contains
230 >    //pointers which can not be copied and managered safely, except make the generic data
231 >    //at PropertyMap as copy on write shared pointer
232 >    AtomType(const AtomType&);
233 >    AtomType& operator=(const AtomType& atomType);
234  
235              
236 <            PropertyMap properties_;
236 >    PropertyMap properties_;
237              
238 <    };
238 >  };
239  
240 <    struct LJParam {
241 <        double epsilon;
242 <        double sigma;
243 <        int soft_pot;
244 <    };
245 <    typedef SimpleTypeData<LJParam> LJParamGenericData;
240 >  struct LJParam {
241 >    double epsilon;
242 >    double sigma;
243 >    int soft_pot;
244 >  };
245 >  typedef SimpleTypeData<LJParam> LJParamGenericData;
246  
247 <    struct EAMParam {
248 <        double latticeConstant;        
249 <        int nrho;
250 <        double drho;
251 <        int nr;
252 <        double dr;
253 <        double rcut;
254 <        std::vector<double> rvals;
255 <        std::vector<double> rhovals;
256 <        std::vector<double> Frhovals;    
257 <    };
247 >  struct EAMParam {
248 >    double latticeConstant;        
249 >    int nrho;
250 >    double drho;
251 >    int nr;
252 >    double dr;
253 >    double rcut;
254 >    std::vector<double> rvals;
255 >    std::vector<double> rhovals;
256 >    std::vector<double> Frhovals;    
257 >  };
258  
259 <    typedef SimpleTypeData<EAMParam> EAMParamGenericData;
259 >  typedef SimpleTypeData<EAMParam> EAMParamGenericData;
260 >  
261 >  struct SCParam {
262 >    double c;
263 >    double m;
264 >    double n;
265 >    double alpha;
266 >    double epsilon;
267 >  };
268 >  typedef SimpleTypeData<SCParam> SCParamGenericData;
269 >  
270 >  
271 >  
272 >  
273   }
274  
275   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines