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 829 by gezelter, Tue Oct 28 16:03:37 2003 UTC

# Line 1 | Line 1
1 < #include <cmath>
1 > #include <math.h>
2  
3   #include "Atom.hpp"
4   #include "simError.h"
# 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", index );
43      painCave.isFatal = 1;
44      simError();
45    }
46 <  return 0;
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 + }
62 +
63   void DirectionalAtom::setMu( double the_mu ) {
64  
65    if( hasCoords ){
66 <    mu[index] = the_mu;
66 >    *mu = the_mu;
67 >    myMu = the_mu;
68    }
69    else{
70 <    
49 <    sprintf( painCave.errMsg,
50 <             "Attempt to set Mu for atom %d before coords set.\n",
51 <             index );
52 <    painCave.isFatal = 1;
53 <    simError();
70 >    myMu = the_mu;
71    }
72   }
73  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines