| 296 |
|
hasVolume = true; |
| 297 |
|
frameData.volume = vol; |
| 298 |
|
} |
| 299 |
+ |
|
| 300 |
|
|
| 301 |
|
/** Wrap a vector according to periodic boundary conditions */ |
| 302 |
|
void Snapshot::wrapVector(Vector3d& pos) { |
| 303 |
|
|
| 304 |
|
if( !frameData.orthoRhombic ) { |
| 305 |
|
Vector3d scaled = frameData.invHmat * pos; |
| 306 |
< |
for (int i = 0; i < 3; i++) |
| 307 |
< |
scaled[i] -= roundMe(scaled[i]); |
| 306 |
> |
for (int i = 0; i < 3; i++) { |
| 307 |
> |
scaled[i] -= roundMe( scaled[i] ); |
| 308 |
> |
} |
| 309 |
|
// calc the wrapped real coordinates from the wrapped scaled coordinates |
| 310 |
|
pos = frameData.hmat * scaled; |
| 311 |
|
} else { |
| 310 |
– |
// calc the scaled coordinates. |
| 312 |
|
RealType scaled; |
| 313 |
< |
for (int i=0; i<3; i++) { |
| 314 |
< |
scaled = pos[i] * frameData.invHmat(i, i); |
| 315 |
< |
scaled -= roundMe(scaled); |
| 316 |
< |
pos[i] = scaled * frameData.hmat(i, i); |
| 313 |
> |
for (int i=0; i<3; i++) { |
| 314 |
> |
scaled = pos[i] * frameData.invHmat(i,i); |
| 315 |
> |
scaled -= roundMe( scaled ); |
| 316 |
> |
pos[i] = scaled * frameData.hmat(i,i); |
| 317 |
|
} |
| 318 |
|
} |
| 319 |
|
} |
| 320 |
|
|
| 320 |
– |
|
| 321 |
|
/** Scaling a vector to multiples of the periodic box */ |
| 322 |
|
inline Vector3d Snapshot::scaleVector(Vector3d& pos) { |
| 323 |
|
|