--- trunk/OOPSE/libmdtools/DirectionalAtom.cpp 2003/08/07 21:47:18 670 +++ trunk/OOPSE/libmdtools/DirectionalAtom.cpp 2003/08/12 19:56:49 689 @@ -23,18 +23,40 @@ double DirectionalAtom::getMu( void ) { } } -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[index] = myMu; + +} + +double DirectionalAtom::getMu( void ) { + + if( hasCoords ){ + return mu[index]; + } + else{ + return myMu; } return 0; } @@ -43,14 +65,10 @@ void DirectionalAtom::setMu( double the_mu ) { if( hasCoords ){ mu[index] = 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; } }