| 1 |
#ifndef _ATOM_H_ |
| 2 |
#define _ATOM_H_ |
| 3 |
|
| 4 |
#include <cstring> |
| 5 |
#include <iostream> |
| 6 |
|
| 7 |
class Atom{ |
| 8 |
public: |
| 9 |
Atom() { |
| 10 |
c_n_hyd = 0; |
| 11 |
has_dipole = 0; |
| 12 |
is_VDW = 0; |
| 13 |
is_LJ = 0; |
| 14 |
} |
| 15 |
virtual ~Atom() {} |
| 16 |
|
| 17 |
double getX() const {return c_x;} |
| 18 |
double getY() const {return c_y;} |
| 19 |
double getZ() const {return c_z;} |
| 20 |
void setX(double x) {c_x = x;} |
| 21 |
void setY(double y) {c_y = y;} |
| 22 |
void setZ(double z) {c_z = z;} |
| 23 |
|
| 24 |
double get_vx() const {return c_vx;} |
| 25 |
double get_vy() const {return c_vy;} |
| 26 |
double get_vz() const {return c_vz;} |
| 27 |
void set_vx(double vx) {c_vx = vx;} |
| 28 |
void set_vy(double vy) {c_vy = vy;} |
| 29 |
void set_vz(double vz) {c_vz = vz;} |
| 30 |
|
| 31 |
double getFx() const {return c_Fx;} |
| 32 |
double getFy() const {return c_Fy;} |
| 33 |
double getFz() const {return c_Fz;} |
| 34 |
void addFx(double add) {c_Fx += add;} |
| 35 |
void addFy(double add) {c_Fy += add;} |
| 36 |
void addFz(double add) {c_Fz += add;} |
| 37 |
virtual void zeroForces() = 0; |
| 38 |
|
| 39 |
double getMass() const {return c_mass;} |
| 40 |
void setMass(double mass) {c_mass = mass;} |
| 41 |
|
| 42 |
double getSigma() const {return c_sigma;} |
| 43 |
void setSigma(double sigma) {c_sigma = sigma;} |
| 44 |
|
| 45 |
double getEpslon() const {return c_epslon;} |
| 46 |
void setEpslon(double epslon) {c_epslon = epslon;} |
| 47 |
|
| 48 |
double getCovalent() const {return c_covalent;} |
| 49 |
void setCovalent(double covalent) {c_covalent = covalent;} |
| 50 |
|
| 51 |
int getIndex() const {return c_index;} |
| 52 |
void setIndex(int index) {c_index = index;} |
| 53 |
|
| 54 |
char *getType() {return c_name;} |
| 55 |
void setType(char * name) {strcpy(c_name,name);} |
| 56 |
|
| 57 |
void set_n_hydrogens( int n_h ) {c_n_hyd = n_h;} |
| 58 |
int get_n_hydrogens() const {return c_n_hyd;} |
| 59 |
|
| 60 |
void setHasDipole( int value ) { has_dipole = value; } |
| 61 |
short int hasDipole( void ) { return has_dipole; } |
| 62 |
|
| 63 |
void setLJ( void ) { is_LJ = 1; is_VDW = 0; } |
| 64 |
short int isLJ( void ) { return is_LJ; } |
| 65 |
|
| 66 |
void seVDW( void ) { is_VDW = 1; is_LJ = 0; } |
| 67 |
short int isVDW( void ) { return is_VDW; } |
| 68 |
|
| 69 |
virtual int isDirectional( void ) = 0; |
| 70 |
|
| 71 |
protected: |
| 72 |
double c_x; /*the atom's position */ |
| 73 |
double c_y; |
| 74 |
double c_z; |
| 75 |
|
| 76 |
double c_vx; /*the atom's velocity */ |
| 77 |
double c_vy; |
| 78 |
double c_vz; |
| 79 |
|
| 80 |
double c_Fx; /* the atom's forces */ |
| 81 |
double c_Fy; |
| 82 |
double c_Fz; |
| 83 |
|
| 84 |
double c_mass; /* the mass of the atom in amu */ |
| 85 |
double c_sigma; /* the sigma parameter for van der walls interactions */ |
| 86 |
double c_epslon; /* the esplon parameter for VDW interactions */ |
| 87 |
double c_covalent; // The covalent radius of the atom. |
| 88 |
|
| 89 |
int c_index; /* set the atom's index */ |
| 90 |
|
| 91 |
char c_name[100]; /* it's name */ |
| 92 |
|
| 93 |
int c_n_hyd; // the number of hydrogens bonded to the atom |
| 94 |
|
| 95 |
short int has_dipole; // dipole boolean |
| 96 |
short int is_VDW; // VDW boolean |
| 97 |
short int is_LJ; // LJ boolean |
| 98 |
|
| 99 |
}; |
| 100 |
|
| 101 |
class GeneralAtom : public Atom{ |
| 102 |
|
| 103 |
public: |
| 104 |
GeneralAtom(){} |
| 105 |
virtual ~GeneralAtom(){} |
| 106 |
|
| 107 |
int isDirectional( void ){ return 0; } |
| 108 |
void zeroForces() { |
| 109 |
c_Fx = 0.0; c_Fy = 0.0; c_Fz = 0.0; |
| 110 |
} |
| 111 |
}; |
| 112 |
|
| 113 |
class DirectionalAtom : public Atom { |
| 114 |
|
| 115 |
public: |
| 116 |
DirectionalAtom() { ssdIdentity = 0; } |
| 117 |
virtual ~DirectionalAtom() {} |
| 118 |
|
| 119 |
int isDirectional(void) { return 1; } |
| 120 |
|
| 121 |
void setSSD( int value) { ssdIdentity = value; } |
| 122 |
int isSSD(void) {return ssdIdentity; } |
| 123 |
|
| 124 |
void setA( double the_A[3][3] ); |
| 125 |
|
| 126 |
void setI( double the_I[3][3] ); |
| 127 |
|
| 128 |
void setQ( double the_q[4] ); |
| 129 |
|
| 130 |
void setEuler( double phi, double theta, double psi ); |
| 131 |
|
| 132 |
void setSUx( double the_sux ) { sux = the_sux; } |
| 133 |
void setSUy( double the_suy ) { suy = the_suy; } |
| 134 |
void setSUz( double the_suz ) { suz = the_suz; } |
| 135 |
|
| 136 |
void setJx( double the_jx ) { jx = the_jx; } |
| 137 |
void setJy( double the_jy ) { jy = the_jy; } |
| 138 |
void setJz( double the_jz ) { jz = the_jz; } |
| 139 |
|
| 140 |
void addTx( double the_tx ) { tx += the_tx;} |
| 141 |
void addTy( double the_ty ) { ty += the_ty;} |
| 142 |
void addTz( double the_tz ) { tz += the_tz;} |
| 143 |
|
| 144 |
void setMu( double the_mu ) { mu = the_mu; } |
| 145 |
|
| 146 |
void zeroForces() { |
| 147 |
c_Fx = 0.0; c_Fy = 0.0; c_Fz = 0.0; |
| 148 |
tx = 0.0; ty = 0.0; tz = 0.0; |
| 149 |
} |
| 150 |
|
| 151 |
double getAxx( void ) { return Axx; } |
| 152 |
double getAxy( void ) { return Axy; } |
| 153 |
double getAxz( void ) { return Axz; } |
| 154 |
|
| 155 |
double getAyx( void ) { return Ayx; } |
| 156 |
double getAyy( void ) { return Ayy; } |
| 157 |
double getAyz( void ) { return Ayz; } |
| 158 |
|
| 159 |
double getAzx( void ) { return Azx; } |
| 160 |
double getAzy( void ) { return Azy; } |
| 161 |
double getAzz( void ) { return Azz; } |
| 162 |
|
| 163 |
void getA( double the_A[3][3] ); // get the full rotation matrix |
| 164 |
|
| 165 |
double getSUx( void ) { return sux; } |
| 166 |
double getSUy( void ) { return suy; } |
| 167 |
double getSUz( void ) { return suz; } |
| 168 |
|
| 169 |
void getU( double the_u[3] ); // get the unit vector |
| 170 |
void getQ( double the_q[4] ); // get the quanternions |
| 171 |
|
| 172 |
double getJx( void ) { return jx; } |
| 173 |
double getJy( void ) { return jy; } |
| 174 |
double getJz( void ) { return jz; } |
| 175 |
|
| 176 |
double getTx( void ) { return tx; } |
| 177 |
double getTy( void ) { return ty; } |
| 178 |
double getTz( void ) { return tz; } |
| 179 |
|
| 180 |
double getIxx( void ) { return Ixx; } |
| 181 |
double getIxy( void ) { return Ixy; } |
| 182 |
double getIxz( void ) { return Ixz; } |
| 183 |
|
| 184 |
double getIyx( void ) { return Iyx; } |
| 185 |
double getIyy( void ) { return Iyy; } |
| 186 |
double getIyz( void ) { return Iyz; } |
| 187 |
|
| 188 |
double getIzx( void ) { return Izx; } |
| 189 |
double getIzy( void ) { return Izy; } |
| 190 |
double getIzz( void ) { return Izz; } |
| 191 |
|
| 192 |
double getMu( void ) { return mu; } |
| 193 |
|
| 194 |
void lab2Body( double r[3] ); |
| 195 |
void body2Lab( double r[3] ); |
| 196 |
|
| 197 |
private: |
| 198 |
|
| 199 |
double Axx, Axy, Axz;; // the rotational matrix |
| 200 |
double Ayx, Ayy, Ayz; |
| 201 |
double Azx, Azy, Azz; |
| 202 |
|
| 203 |
double sux, suy, suz; // the standard unit vector ( body fixed ) |
| 204 |
double jx, jy, jz; // the angular momentum vector ( body fixed ) |
| 205 |
double tx, ty, tz; // the torque vector ( space fixed ) |
| 206 |
|
| 207 |
double Ixx, Ixy, Ixz; // the inertial tensor matrix ( body fixed ) |
| 208 |
double Iyx, Iyy, Iyz; |
| 209 |
double Izx, Izy, Izz; |
| 210 |
|
| 211 |
double mu; // the magnitude of the dipole moment |
| 212 |
|
| 213 |
int ssdIdentity; // boolean of whether atom is ssd |
| 214 |
|
| 215 |
}; |
| 216 |
|
| 217 |
#endif |