| 1 | #ifndef _ATOM_H_ | 
| 2 | #define _ATOM_H_ | 
| 3 |  | 
| 4 | #include <string.h> | 
| 5 | #include <stdlib.h> | 
| 6 | #include <iostream> | 
| 7 |  | 
| 8 | #include "brains/SimState.hpp" | 
| 9 | #include "primitives/StuntDouble.hpp" | 
| 10 | #include "visitors/BaseVisitor.hpp" | 
| 11 |  | 
| 12 | class Atom : public StuntDouble { | 
| 13 | public: | 
| 14 |  | 
| 15 | Atom(int theIndex, SimState* theConfig ); | 
| 16 | virtual ~Atom() {} | 
| 17 |  | 
| 18 | virtual void setCoords(void); | 
| 19 |  | 
| 20 | void getPos( double theP[3] ); | 
| 21 | void setPos( double theP[3] ); | 
| 22 |  | 
| 23 | void getVel( double theV[3] ); | 
| 24 | void setVel( double theV[3] ); | 
| 25 |  | 
| 26 | void getFrc( double theF[3] ); | 
| 27 | void addFrc( double theF[3] ); | 
| 28 |  | 
| 29 | virtual void zeroForces(); | 
| 30 |  | 
| 31 | double getMass() {return c_mass;} | 
| 32 | void setMass(double mass) {c_mass = mass;} | 
| 33 |  | 
| 34 | int getIndex() const {return index;} | 
| 35 | void setIndex(int theIndex); | 
| 36 |  | 
| 37 | char *getType() {return c_name;} | 
| 38 | void setType(char * name) {strcpy(c_name,name);} | 
| 39 |  | 
| 40 | int getIdent( void ) { return ident; } | 
| 41 | void setIdent( int info ) { ident = info; } | 
| 42 |  | 
| 43 | #ifdef IS_MPI | 
| 44 | int getGlobalIndex( void ) { return myGlobalIndex; } | 
| 45 | void setGlobalIndex( int info ) { myGlobalIndex = info; } | 
| 46 | #endif // is_mpi | 
| 47 |  | 
| 48 | void setHasDipole( int value ) { has_dipole = value; } | 
| 49 | int hasDipole( void ) { return has_dipole; } | 
| 50 |  | 
| 51 | void setHasCharge(int value) {has_charge = value;} | 
| 52 | int hasCharge(void) {return has_charge;} | 
| 53 |  | 
| 54 |  | 
| 55 | virtual void accept(BaseVisitor* v) {v->visit(this);} | 
| 56 |  | 
| 57 | protected: | 
| 58 |  | 
| 59 | SimState* myConfig; | 
| 60 |  | 
| 61 | double* pos; // the position array | 
| 62 | double* vel; // the velocity array | 
| 63 | double* frc; // the forc array | 
| 64 | double* trq; // the torque vector  ( space fixed ) | 
| 65 | double* Amat; // the rotation matrix | 
| 66 | double* mu;   // the array of dipole moments | 
| 67 | double* ul;   // the lab frame unit directional vector | 
| 68 |  | 
| 69 | double zAngle; // the rotation about the z-axis ( body-fixed ) | 
| 70 |  | 
| 71 | double c_mass; /* the mass of the atom in amu */ | 
| 72 |  | 
| 73 | int index; /* set the atom's index */ | 
| 74 | int offset; // the atom's offset in the storage array | 
| 75 | int offsetX, offsetY, offsetZ; | 
| 76 |  | 
| 77 | int Axx, Axy, Axz; // the rotational matrix indices | 
| 78 | int Ayx, Ayy, Ayz; | 
| 79 | int Azx, Azy, Azz; | 
| 80 |  | 
| 81 | char c_name[100]; /* it's name */ | 
| 82 | int ident;  // it's unique numeric identity. | 
| 83 |  | 
| 84 | int has_dipole; // dipole boolean | 
| 85 | int has_charge; // charge boolean | 
| 86 |  | 
| 87 | bool hasCoords; | 
| 88 |  | 
| 89 | #ifdef IS_MPI | 
| 90 | int myGlobalIndex; | 
| 91 | #endif | 
| 92 |  | 
| 93 | }; | 
| 94 |  | 
| 95 | #endif |