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

Comparing:
trunk/OOPSE-3.0/src/types/AtomType.hpp (file contents), Revision 1631 by gezelter, Fri Oct 22 14:47:53 2004 UTC vs.
branches/new_design/OOPSE-3.0/src/types/AtomType.hpp (file contents), Revision 1813 by tim, Wed Dec 1 17:38:32 2004 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines