--- branches/mmeineke/OOPSE/libmdtools/Atom.hpp 2003/03/21 17:42:12 377 +++ trunk/OOPSE/libmdtools/Atom.hpp 2003/08/07 00:47:33 669 @@ -7,78 +7,27 @@ class Atom{ (public) class Atom{ public: - Atom(int theIndex) { - c_n_hyd = 0; - has_dipole = 0; - is_VDW = 0; - is_LJ = 0; - index = theIndex; - offset = 3 * index; - offsetX = offset; - offsetY = offset+1; - offsetZ = offset+2; + Atom(int theIndex); + virtual ~Atom() {} - Axx = index*9; - Axy = Axx+1; - Axz = Axx+2; - - Ayx = Axx+3; - Ayy = Axx+4; - Ayz = Axx+5; + static double* pos; // the position array + static double* vel; // the velocity array + static double* frc; // the forc array + static double* trq; // the torque vector ( space fixed ) + static double* Amat; // the rotation matrix + static double* mu; // the dipole moment array + static double* ul; // the lab frame unit directional vector + static int nElements; - Azx = Axx+6; - Azy = Axx+7; - Azz = Axx+8; - } - virtual ~Atom() {} + static void createArrays (int the_nElements); + static void destroyArrays(void); + void addAtoms(int nAdded, double* Apos, double* Avel, double* Afrc, + double* Atrq, double* AAmat, double* Amu, + double* Aul); + void deleteAtom(int theIndex); + void deleteRange(int startIndex, int stopIndex); - static void createArrays (int nElements) { - int i; - - pos = new double[nElements*3]; - vel = new double[nElements*3]; - frc = new double[nElements*3]; - trq = new double[nElements*3]; - Amat = new double[nElements*9]; - mu = new double[nElements]; - ul = new double[nElements*3]; - - // init directional values to zero - - for( i=0; i