| 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[index] = myMu; |
| 50 |
+ |
|
| 51 |
+ |
} |
| 52 |
+ |
|
| 53 |
+ |
double DirectionalAtom::getMu( void ) { |
| 54 |
+ |
|
| 55 |
+ |
if( hasCoords ){ |
| 56 |
+ |
return mu[index]; |
| 57 |
+ |
} |
| 58 |
+ |
else{ |
| 59 |
+ |
return myMu; |
| 60 |
|
} |
| 61 |
|
return 0; |
| 62 |
|
} |
| 65 |
|
|
| 66 |
|
if( hasCoords ){ |
| 67 |
|
mu[index] = 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 |
|
|