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 1740 by tim, Mon Nov 15 23:00: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 < namespace oopse {
14 <  /**
15 <   * @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();
13 > using name_space std;
14 >
15 > name_space oopse {
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 >             * Finishes off the AtomType by communicating the logical portions of the
31 >             * structure to the Fortran atype module
32 >             */
33 >            void complete();
34 >
35 >            void setMass(double m) {
36 >                mass_ = m;
37 >            }
38 >
39 >            double getMass(void) {
40 >                return mass_;
41 >            }
42 >
43 >            void setIdent(int id) {
44 >                atp_.ident = id;
45 >            }
46 >
47 >            int getIdent() {
48 >                return atp_.ident;
49 >            }
50 >
51 >            void setName(const std::string&name) {
52 >                name_ = name;
53 >            }
54 >
55 >            std::string getName() {
56 >                return name_;
57 >            }
58 >
59 >            void setLennardJones() {
60 >                atp_.is_LennardJones = 1;
61 >            }
62 >
63 >            bool isLennardJones() {
64 >                return atp_.is_LennardJones;
65 >            }
66 >
67 >            void setElectrostatic() {
68 >                atp_.is_Electrostatic = 1;
69 >            }
70 >
71 >            bool isElectrostatic() {
72 >                return atp_.is_Electrostatic;
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 >                atp_.is_Electrostatic = 1;
86 >            }
87 >
88 >            bool isCharge() {
89 >                return atp_.is_Charge;
90 >            }
91 >
92 >            bool isDirectional() {
93 >                return atp_.is_Directional;
94 >            }
95 >
96 >            bool isDipole() {
97 >                return atp_.is_Dipole;
98 >            }
99 >
100 >            bool isGayBerne() {
101 >                return atp_.is_GayBerne;
102 >            }
103 >
104 >            bool isSticky() {
105 >                return atp_.is_Sticky;
106 >            }
107 >
108 >            bool isShape() {
109 >                return atp_.is_Shape;
110 >            }
111 >
112 >            //below functions are just forward functions
113 >            /**
114 >             * Adds property into property map
115 >             * @param genData GenericData to be added into PropertyMap
116 >             */
117 >            void addProperty(GenericData* genData);
118 >
119 >            /**
120 >             * Removes property from PropertyMap by name
121 >             * @param propName the name of property to be removed
122 >             */
123 >            void removeProperty(const std::string& propName);
124 >
125 >            /**
126 >             * clear all of the properties
127 >             */
128 >            void clearProperties();
129 >
130 >            /**
131 >             * Returns all names of properties
132 >             * @return all names of properties
133 >             */
134 >            std::vector<std::string> getPropertyNames();
135 >
136 >            /**
137 >             * Returns all of the properties in PropertyMap
138 >             * @return all of the properties in PropertyMap
139 >             */      
140 >            std::vector<GenericData*> getProperties();
141 >
142 >            /**
143 >             * Returns property
144 >             * @param propName name of property
145 >             * @return a pointer point to property with propName. If no property named propName
146 >             * exists, return NULL
147 >             */      
148 >        GenericData* getPropertyByName(const std::string& propName);
149 >
150 >        protected:
151 >
152 >            AtomTypeProperties atp_;
153 >            double mass_;
154 >            std::string name_;
155 >
156 >        private:
157 >            //prevent copy construction and copy assignment, since property map contains
158 >            //pointers which can not be copied and managered safely, except make the generic data
159 >            //at PropertyMap as copy on write shared pointer
160 >            AtomType(const AtomType&);
161 >            AtomType& operator=(const AtomType& atomType);
162 >
163 >            
164 >            PropertyMap properties_;
165 >            
166 >    };
167 >
168   }
169 +
170   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines