1 |
|
#ifndef _ATOM_H_ |
2 |
|
#define _ATOM_H_ |
3 |
|
|
4 |
< |
#include <cstring> |
5 |
< |
#include <cstdlib> |
4 |
> |
#include <string.h> |
5 |
> |
#include <stdlib.h> |
6 |
|
#include <iostream> |
7 |
|
|
8 |
|
#include "SimState.hpp" |
9 |
+ |
#include "StuntDouble.hpp" |
10 |
|
|
11 |
< |
class Atom{ |
11 |
> |
class Atom : public StuntDouble { |
12 |
|
public: |
13 |
|
|
14 |
|
Atom(int theIndex, SimState* theConfig ); |
16 |
|
|
17 |
|
virtual void setCoords(void); |
18 |
|
|
18 |
– |
// void addAtoms(int nAdded, double* Apos, double* Avel, double* Afrc, |
19 |
– |
// double* Atrq, double* AAmat, double* Amu, |
20 |
– |
// double* Aul); |
21 |
– |
// void deleteAtom(int theIndex); |
22 |
– |
// void deleteRange(int startIndex, int stopIndex); |
23 |
– |
|
19 |
|
void getPos( double theP[3] ); |
20 |
|
void setPos( double theP[3] ); |
21 |
|
|
25 |
|
void getFrc( double theF[3] ); |
26 |
|
void addFrc( double theF[3] ); |
27 |
|
|
28 |
< |
virtual void zeroForces() = 0; |
28 |
> |
virtual void zeroForces(); |
29 |
|
|
30 |
< |
double getMass() const {return c_mass;} |
30 |
> |
double getMass() {return c_mass;} |
31 |
|
void setMass(double mass) {c_mass = mass;} |
37 |
– |
|
38 |
– |
double getEamRcut() const {return myEamRcut;} |
39 |
– |
void setEamRcut(double eamRcut) {myEamRcut = eamRcut;} |
32 |
|
|
41 |
– |
double getSigma() const {return c_sigma;} |
42 |
– |
void setSigma(double sigma) {c_sigma = sigma;} |
43 |
– |
|
44 |
– |
double getEpslon() const {return c_epslon;} |
45 |
– |
void setEpslon(double epslon) {c_epslon = epslon;} |
46 |
– |
|
47 |
– |
double getCovalent() const {return c_covalent;} |
48 |
– |
void setCovalent(double covalent) {c_covalent = covalent;} |
49 |
– |
|
33 |
|
int getIndex() const {return index;} |
34 |
|
void setIndex(int theIndex); |
35 |
+ |
|
36 |
|
char *getType() {return c_name;} |
37 |
|
void setType(char * name) {strcpy(c_name,name);} |
38 |
|
|
44 |
|
void setGlobalIndex( int info ) { myGlobalIndex = info; } |
45 |
|
#endif // is_mpi |
46 |
|
|
63 |
– |
void set_n_hydrogens( int n_h ) {c_n_hyd = n_h;} |
64 |
– |
int get_n_hydrogens() const {return c_n_hyd;} |
65 |
– |
|
47 |
|
void setHasDipole( int value ) { has_dipole = value; } |
48 |
|
int hasDipole( void ) { return has_dipole; } |
49 |
|
|
69 |
– |
void setLJ( void ) { is_LJ = 1; is_VDW = 0; } |
70 |
– |
int isLJ( void ) { return is_LJ; } |
71 |
– |
|
72 |
– |
void seVDW( void ) { is_VDW = 1; is_LJ = 0; } |
73 |
– |
int isVDW( void ) { return is_VDW; } |
74 |
– |
|
75 |
– |
void setEAM( void ) { is_EAM = 1; } |
76 |
– |
int isEAM( void ) { return is_EAM; } |
77 |
– |
|
78 |
– |
virtual int isDirectional( void ) = 0; |
79 |
– |
|
80 |
– |
|
50 |
|
protected: |
51 |
|
|
52 |
|
SimState* myConfig; |
60 |
|
double* ul; // the lab frame unit directional vector |
61 |
|
|
62 |
|
double c_mass; /* the mass of the atom in amu */ |
94 |
– |
double c_sigma; /* the sigma parameter for van der walls interactions */ |
95 |
– |
double c_epslon; /* the esplon parameter for VDW interactions */ |
96 |
– |
double c_covalent; // The covalent radius of the atom. |
63 |
|
|
98 |
– |
double myEamRcut; // Atom rcut for eam defined by the forcefield. |
99 |
– |
|
64 |
|
int index; /* set the atom's index */ |
65 |
|
int offset; // the atom's offset in the storage array |
66 |
|
int offsetX, offsetY, offsetZ; |
71 |
|
|
72 |
|
char c_name[100]; /* it's name */ |
73 |
|
int ident; // it's unique numeric identity. |
110 |
– |
|
111 |
– |
int c_n_hyd; // the number of hydrogens bonded to the atom |
74 |
|
|
75 |
|
int has_dipole; // dipole boolean |
114 |
– |
int is_VDW; // VDW boolean |
115 |
– |
int is_LJ; // LJ boolean |
116 |
– |
int is_EAM; //EAM boolean |
76 |
|
|
77 |
|
bool hasCoords; |
78 |
|
|
82 |
|
|
83 |
|
}; |
84 |
|
|
126 |
– |
class GeneralAtom : public Atom{ |
127 |
– |
|
128 |
– |
public: |
129 |
– |
GeneralAtom(int theIndex, SimState* theConfig): Atom(theIndex, theConfig){} |
130 |
– |
virtual ~GeneralAtom(){} |
131 |
– |
|
132 |
– |
int isDirectional( void ){ return 0; } |
133 |
– |
void zeroForces( void ); |
134 |
– |
}; |
135 |
– |
|
136 |
– |
class DirectionalAtom : public Atom { |
137 |
– |
|
138 |
– |
public: |
139 |
– |
DirectionalAtom(int theIndex, SimState* theConfig) : Atom(theIndex, |
140 |
– |
theConfig) |
141 |
– |
{ |
142 |
– |
ssdIdentity = 0; |
143 |
– |
sux = 0.0; |
144 |
– |
suy = 0.0; |
145 |
– |
suz = 0.0; |
146 |
– |
myMu = 0.0; |
147 |
– |
} |
148 |
– |
virtual ~DirectionalAtom() {} |
149 |
– |
|
150 |
– |
virtual void setCoords(void); |
151 |
– |
|
152 |
– |
void printAmatIndex( void ); |
153 |
– |
|
154 |
– |
int isDirectional(void) { return 1; } |
155 |
– |
|
156 |
– |
void setSSD( int value) { ssdIdentity = value; } |
157 |
– |
int isSSD(void) {return ssdIdentity; } |
158 |
– |
|
159 |
– |
|
160 |
– |
void setEuler( double phi, double theta, double psi ); |
161 |
– |
|
162 |
– |
double getSUx( void ) { return sux; } |
163 |
– |
double getSUy( void ) { return suy; } |
164 |
– |
double getSUz( void ) { return suz; } |
165 |
– |
|
166 |
– |
void setSUx( double the_sux ) { sux = the_sux; } |
167 |
– |
void setSUy( double the_suy ) { suy = the_suy; } |
168 |
– |
void setSUz( double the_suz ) { suz = the_suz; } |
169 |
– |
|
170 |
– |
void zeroForces(); |
171 |
– |
|
172 |
– |
void getA( double the_A[3][3] ); // get the full rotation matrix |
173 |
– |
void setA( double the_A[3][3] ); |
174 |
– |
|
175 |
– |
void getU( double the_u[3] ); // get the unit vetor |
176 |
– |
void updateU( void ); |
177 |
– |
|
178 |
– |
void getQ( double the_q[4] ); // get the quanternions |
179 |
– |
void setQ( double the_q[4] ); |
180 |
– |
|
181 |
– |
void getJ( double theJ[3] ); |
182 |
– |
void setJ( double theJ[3] ); |
183 |
– |
|
184 |
– |
double getJx( void ) { return jx; } |
185 |
– |
double getJy( void ) { return jy; } |
186 |
– |
double getJz( void ) { return jz; } |
187 |
– |
|
188 |
– |
void setJx( double the_jx ) { jx = the_jx; } |
189 |
– |
void setJy( double the_jy ) { jy = the_jy; } |
190 |
– |
void setJz( double the_jz ) { jz = the_jz; } |
191 |
– |
|
192 |
– |
void getTrq( double theT[3] ); |
193 |
– |
void addTrq( double theT[3] ); |
194 |
– |
|
195 |
– |
// double getTx( void ) { return trq[offsetX];} |
196 |
– |
// double getTy( void ) { return trq[offsetY]; } |
197 |
– |
// double getTz( void ) { return trq[offsetZ]; } |
198 |
– |
|
199 |
– |
void setI( double the_I[3][3] ); |
200 |
– |
void getI( double the_I[3][3] ); |
201 |
– |
|
202 |
– |
double getIxx( void ) { return Ixx; } |
203 |
– |
double getIxy( void ) { return Ixy; } |
204 |
– |
double getIxz( void ) { return Ixz; } |
205 |
– |
|
206 |
– |
double getIyx( void ) { return Iyx; } |
207 |
– |
double getIyy( void ) { return Iyy; } |
208 |
– |
double getIyz( void ) { return Iyz; } |
209 |
– |
|
210 |
– |
double getIzx( void ) { return Izx; } |
211 |
– |
double getIzy( void ) { return Izy; } |
212 |
– |
double getIzz( void ) { return Izz; } |
213 |
– |
|
214 |
– |
double getMu( void ); |
215 |
– |
void setMu( double the_mu ); |
216 |
– |
|
217 |
– |
void lab2Body( double r[3] ); |
218 |
– |
void body2Lab( double r[3] ); |
219 |
– |
|
220 |
– |
|
221 |
– |
private: |
222 |
– |
int dIndex; |
223 |
– |
|
224 |
– |
double myMu; |
225 |
– |
|
226 |
– |
double sux, suy, suz; // the standard unit vector ( body fixed ) |
227 |
– |
double jx, jy, jz; // the angular momentum vector ( body fixed ) |
228 |
– |
|
229 |
– |
double Ixx, Ixy, Ixz; // the inertial tensor matrix ( body fixed ) |
230 |
– |
double Iyx, Iyy, Iyz; |
231 |
– |
double Izx, Izy, Izz; |
232 |
– |
|
233 |
– |
int ssdIdentity; // boolean of whether atom is ssd |
234 |
– |
|
235 |
– |
}; |
236 |
– |
|
85 |
|
#endif |