--- trunk/OOPSE/libmdtools/DirectionalAtom.cpp 2003/08/07 21:47:18 670 +++ trunk/OOPSE/libmdtools/DirectionalAtom.cpp 2003/08/12 21:44:06 690 @@ -23,34 +23,52 @@ void DirectionalAtom::zeroForces() { } } -double DirectionalAtom::getMu( void ) { +void DirectionalAtom::setCoords(void){ - if( hasCoords ){ - return mu[index]; + if( myConfig->isAllocated() ){ + + myConfig->getAtomPointers( index, + &pos, + &vel, + &frc, + &trq, + &Amat, + &mu, + &ul ); } else{ - sprintf( painCave.errMsg, - "Attempt to get Mu for atom %d before coords set.\n", - index ); + "Attempted to set Atom %d coordinates with an unallocated " + "SimState object.\n" ); painCave.isFatal = 1; simError(); + } + + hasCoords = true; + + *mu = myMu; + +} + +double DirectionalAtom::getMu( void ) { + + if( hasCoords ){ + return *mu; } + else{ + return myMu; + } return 0; } void DirectionalAtom::setMu( double the_mu ) { if( hasCoords ){ - mu[index] = the_mu; + *mu = the_mu; + myMu = the_mu; } else{ - - sprintf( painCave.errMsg, - "Attempt to set Mu for atom %d before coords set.\n", - index ); - painCave.isFatal = 1; - simError(); + myMu = the_mu; } }