ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-3.0/src/types/AtomType.hpp
Revision: 1769
Committed: Tue Nov 23 06:03:47 2004 UTC (19 years, 9 months ago) by tim
File size: 4962 byte(s)
Log Message:
add EAM AtomType Section Parser

File Contents

# User Rev Content
1 gezelter 1631 #ifndef TYPES_ATOMTYPE_HPP
2 tim 1740
3 gezelter 1631 #define TYPES_ATOMTYPE_HPP
4    
5 gezelter 1652 #include <string>
6    
7 gezelter 1631 #include "utils/PropertyMap.hpp"
8 tim 1740
9 gezelter 1631 #define __C
10     #include "types/AtomTypeProperties.h"
11     #include "UseTheForce/DarkSide/atype_interface.h"
12    
13 tim 1740 using name_space std;
14 gezelter 1652
15 tim 1740 name_space oopse {
16 gezelter 1631 /**
17 tim 1740 * @class AtomType
18     * AtomType is what OOPSE looks to for unchanging data about an atom.
19     * Things that belong to AtomType are universal properties (i.e. does
20     * this atom have a Charge? What is it's mass_?) Dynamic properties of
21     * an atom are not intended to be properties of an atom type
22 gezelter 1631 */
23 tim 1740 class AtomType {
24     public:
25 gezelter 1631
26 tim 1740 AtomType();
27 gezelter 1632
28 tim 1740 virtual ~AtomType() { } ;
29 tim 1769
30     virtual void complete();
31    
32 tim 1740 /**
33     * Finishes off the AtomType by communicating the logical portions of the
34     * structure to the Fortran atype module
35     */
36 tim 1769 void makeFortranAtomType();
37    
38 tim 1740 void setMass(double m) {
39     mass_ = m;
40     }
41    
42     double getMass(void) {
43     return mass_;
44     }
45    
46     void setIdent(int id) {
47     atp_.ident = id;
48     }
49    
50     int getIdent() {
51     return atp_.ident;
52     }
53    
54     void setName(const std::string&name) {
55     name_ = name;
56     }
57    
58     std::string getName() {
59     return name_;
60     }
61    
62     void setLennardJones() {
63     atp_.is_LennardJones = 1;
64     }
65    
66     bool isLennardJones() {
67     return atp_.is_LennardJones;
68     }
69    
70     void setElectrostatic() {
71     atp_.is_Electrostatic = 1;
72     }
73    
74     bool isElectrostatic() {
75     return atp_.is_Electrostatic;
76     }
77    
78     void setEAM() {
79     atp_.is_EAM = 1;
80     }
81    
82     bool isEAM() {
83     return atp_.is_EAM;
84     }
85    
86     void setCharge() {
87     atp_.is_Charge = 1;
88     atp_.is_Electrostatic = 1;
89     }
90    
91     bool isCharge() {
92     return atp_.is_Charge;
93     }
94    
95     bool isDirectional() {
96     return atp_.is_Directional;
97     }
98    
99     bool isDipole() {
100     return atp_.is_Dipole;
101     }
102    
103     bool isGayBerne() {
104     return atp_.is_GayBerne;
105     }
106    
107     bool isSticky() {
108     return atp_.is_Sticky;
109     }
110    
111     bool isShape() {
112     return atp_.is_Shape;
113     }
114    
115     //below functions are just forward functions
116     /**
117     * Adds property into property map
118     * @param genData GenericData to be added into PropertyMap
119     */
120     void addProperty(GenericData* genData);
121    
122     /**
123     * Removes property from PropertyMap by name
124     * @param propName the name of property to be removed
125     */
126     void removeProperty(const std::string& propName);
127    
128     /**
129     * clear all of the properties
130     */
131     void clearProperties();
132    
133     /**
134     * Returns all names of properties
135     * @return all names of properties
136     */
137     std::vector<std::string> getPropertyNames();
138    
139     /**
140     * Returns all of the properties in PropertyMap
141     * @return all of the properties in PropertyMap
142     */
143     std::vector<GenericData*> getProperties();
144    
145     /**
146     * Returns property
147     * @param propName name of property
148     * @return a pointer point to property with propName. If no property named propName
149     * exists, return NULL
150     */
151     GenericData* getPropertyByName(const std::string& propName);
152    
153     protected:
154    
155     AtomTypeProperties atp_;
156     double mass_;
157     std::string name_;
158    
159     private:
160     //prevent copy construction and copy assignment, since property map contains
161     //pointers which can not be copied and managered safely, except make the generic data
162     //at PropertyMap as copy on write shared pointer
163     AtomType(const AtomType&);
164     AtomType& operator=(const AtomType& atomType);
165    
166    
167     PropertyMap properties_;
168 gezelter 1632
169 tim 1740 };
170 gezelter 1632
171 tim 1765 struct LJParam {
172     double epsilon;
173     double sigma;
174     };
175     typedef SimpleTypeData<LJParam> LJParamGenericData;
176 tim 1769
177     struct EAMParam {
178     double latticeConstant;
179     int nrho;
180     double drho;
181     int nr;
182     double dr;
183     double rcut;
184     std::vector<double> rvals;
185     std::vector<double> rhovals;
186     std::vector<double> Frhovals;
187     };
188    
189     typedef SimpleTypeData<EAMParam> EAMParamGenericData;
190 tim 1740 }
191 gezelter 1652
192 gezelter 1631 #endif