| 104 |
|
int i; |
| 105 |
|
|
| 106 |
|
vector<RealType> binMass(nBins_, 0.0); |
| 107 |
< |
vector<Vector3d> binVel(nBins_, V3Zero); |
| 107 |
> |
vector<RealType> binPx(nBins_, 0.0); |
| 108 |
> |
vector<RealType> binPy(nBins_, 0.0); |
| 109 |
> |
vector<RealType> binPz(nBins_, 0.0); |
| 110 |
|
vector<RealType> binKE(nBins_, 0.0); |
| 111 |
|
vector<unsigned int> binDof(nBins_, 0); |
| 112 |
|
vector<unsigned int> binCount(nBins_, 0); |
| 119 |
|
|
| 120 |
|
for (rb = mol->beginRigidBody(rbIter); rb != NULL; |
| 121 |
|
rb = mol->nextRigidBody(rbIter)) { |
| 122 |
< |
rb->updateAtoms(); |
| 122 |
> |
rb->updateAtomVel(); |
| 123 |
|
} |
| 124 |
|
} |
| 125 |
|
|
| 142 |
|
binCount[bin] += 1; |
| 143 |
|
|
| 144 |
|
binMass[bin] += m; |
| 145 |
< |
binVel[bin] += vel; |
| 145 |
> |
binPx[bin] += m * vel.x(); |
| 146 |
> |
binPy[bin] += m * vel.y(); |
| 147 |
> |
binPz[bin] += m * vel.z(); |
| 148 |
|
binKE[bin] += 0.5 * (m * vel.lengthSquare()); |
| 149 |
|
binDof[bin] += 3; |
| 150 |
|
|
| 174 |
|
PhysicalConstants::energyConvert); |
| 175 |
|
RealType den = binMass[i] * nBins_ * PhysicalConstants::densityConvert |
| 176 |
|
/ volume_; |
| 177 |
< |
Vector3d vel = binVel[i] / RealType(binCount[i]); |
| 177 |
> |
Vector3d vel; |
| 178 |
> |
vel.x() = binPx[i] / binMass[i]; |
| 179 |
> |
vel.y() = binPy[i] / binMass[i]; |
| 180 |
> |
vel.z() = binPz[i] / binMass[i]; |
| 181 |
> |
|
| 182 |
|
dynamic_cast<Accumulator *>(temperature->accumulator[i])->add(temp); |
| 183 |
|
dynamic_cast<VectorAccumulator *>(velocity->accumulator[i])->add(vel); |
| 184 |
|
dynamic_cast<Accumulator *>(density->accumulator[i])->add(den); |
| 251 |
|
|
| 252 |
|
for (rb = mol->beginRigidBody(rbIter); rb != NULL; |
| 253 |
|
rb = mol->nextRigidBody(rbIter)) { |
| 254 |
< |
rb->updateAtoms(); |
| 254 |
> |
rb->updateAtomVel(); |
| 255 |
|
} |
| 256 |
|
} |
| 257 |
|
|
| 271 |
|
Vector3d aVel = cross(rPos, vel); |
| 272 |
|
RealType m = sd->getMass(); |
| 273 |
|
|
| 274 |
< |
int bin = getBin(pos); |
| 274 |
> |
int bin = getBin(rPos); |
| 275 |
|
|
| 276 |
|
binCount[bin] += 1; |
| 277 |
|
|