ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/DirectionalAtom.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/DirectionalAtom.cpp (file contents):
Revision 670 by mmeineke, Thu Aug 7 21:47:18 2003 UTC vs.
Revision 690 by mmeineke, Tue Aug 12 21:44:06 2003 UTC

# Line 23 | Line 23 | double DirectionalAtom::getMu( void ) {
23    }
24   }
25  
26 < double DirectionalAtom::getMu( void ) {
26 > void DirectionalAtom::setCoords(void){
27  
28 <  if( hasCoords ){
29 <    return mu[index];
28 >  if( myConfig->isAllocated() ){
29 >
30 >    myConfig->getAtomPointers( index,
31 >                     &pos,
32 >                     &vel,
33 >                     &frc,
34 >                     &trq,
35 >                     &Amat,
36 >                     &mu,  
37 >                     &ul );
38    }
39    else{
32    
40      sprintf( painCave.errMsg,
41 <             "Attempt to get Mu for atom %d before coords set.\n",
42 <             index );
41 >             "Attempted to set Atom %d  coordinates with an unallocated "
42 >             "SimState object.\n" );
43      painCave.isFatal = 1;
44      simError();
45 +  }
46 +
47 +  hasCoords = true;
48 +
49 +  *mu = myMu;
50 +
51 + }
52 +
53 + double DirectionalAtom::getMu( void ) {
54 +
55 +  if( hasCoords ){
56 +    return *mu;
57    }
58 +  else{
59 +    return myMu;
60 +  }
61    return 0;
62   }
63  
64   void DirectionalAtom::setMu( double the_mu ) {
65  
66    if( hasCoords ){
67 <    mu[index] = the_mu;
67 >    *mu = the_mu;
68 >    myMu = the_mu;
69    }
70    else{
71 <    
49 <    sprintf( painCave.errMsg,
50 <             "Attempt to set Mu for atom %d before coords set.\n",
51 <             index );
52 <    painCave.isFatal = 1;
53 <    simError();
71 >    myMu = the_mu;
72    }
73   }
74  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines