--- branches/mmeineke/OOPSE/libmdtools/DirectionalAtom.cpp 2003/03/21 17:42:12 377 +++ trunk/OOPSE/libmdtools/DirectionalAtom.cpp 2003/07/14 21:48:43 599 @@ -2,14 +2,8 @@ #include "Atom.hpp" -double* Atom::pos; // the position array -double* Atom::vel; // the velocity array -double* Atom::frc; // the forc array -double* Atom::trq; // the torque vector ( space fixed ) -double* Atom::Amat; // the rotation matrix -double* Atom::mu; // the array of dipole moments -double* Atom::ul; // the lab frame unit directional vector + void DirectionalAtom::setA( double the_A[3][3] ){ Amat[Axx] = the_A[0][0]; Amat[Axy] = the_A[0][1]; Amat[Axz] = the_A[0][2]; @@ -66,7 +60,15 @@ void DirectionalAtom::getA( double the_A[3][3] ){ the_A[2][2] = Amat[Azz]; } +void DirectionalAtom::printAmatIndex( void ){ + std::cerr << "Atom[" << index << "] index =>\n" + << "[ " << Axx << ", " << Axy << ", " << Axz << " ]\n" + << "[ " << Ayx << ", " << Ayy << ", " << Ayz << " ]\n" + << "[ " << Azx << ", " << Azy << ", " << Azz << " ]\n"; +} + + void DirectionalAtom::getU( double the_u[3] ){ the_u[0] = sux; @@ -175,3 +177,46 @@ void DirectionalAtom::updateU( void ){ ul[offsetZ] = (Amat[Axz] * sux) + (Amat[Ayz] * suy) + (Amat[Azz] * suz); } +void DirectionalAtom::getJ( double theJ[3] ){ + + theJ[0] = jx; + theJ[1] = jy; + theJ[2] = jz; +} + +void DirectionalAtom::setJ( double theJ[3] ){ + + jx = theJ[0]; + jy = theJ[1]; + jz = theJ[2]; +} + +void DirectionalAtom::getTrq( double theT[3] ){ + + theT[0] = trq[offsetX]; + theT[1] = trq[offsetY]; + theT[2] = trq[offsetZ]; +} + +void DirectionalAtom::addTrq( double theT[3] ){ + + trq[offsetX] += theT[0]; + trq[offsetY] += theT[1]; + trq[offsetZ] += theT[2]; +} + + +void DirectionalAtom::getI( double the_I[3][3] ){ + + the_I[0][0] = Ixx; + the_I[0][1] = Ixy; + the_I[0][2] = Ixz; + + the_I[1][0] = Iyx; + the_I[1][1] = Iyy; + the_I[1][2] = Iyz; + + the_I[2][0] = Izx; + the_I[2][1] = Izy; + the_I[2][2] = Izz; +}