| 86 |
|
} |
| 87 |
|
|
| 88 |
|
void RNEMDZ::processFrame(int istep) { |
| 89 |
+ |
RealType z; |
| 90 |
+ |
|
| 91 |
+ |
hmat_ = currentSnapshot_->getHmat(); |
| 92 |
+ |
for (int i = 0; i < nBins_; i++) { |
| 93 |
+ |
z = (((RealType)i + 0.5) / (RealType)nBins_) * hmat_(2,2); |
| 94 |
+ |
dynamic_cast<Accumulator*>(z_->accumulator[i])->add(z); |
| 95 |
+ |
} |
| 96 |
+ |
volume_ = currentSnapshot_->getVolume(); |
| 97 |
+ |
|
| 98 |
+ |
|
| 99 |
|
Molecule* mol; |
| 100 |
|
RigidBody* rb; |
| 101 |
|
StuntDouble* sd; |
| 106 |
|
vector<RealType> binMass(nBins_, 0.0); |
| 107 |
|
vector<Vector3d> binVel(nBins_, V3Zero); |
| 108 |
|
vector<RealType> binKE(nBins_, 0.0); |
| 109 |
< |
vector<int> binDof(nBins_, 0); |
| 110 |
< |
vector<int> binCount(nBins_, 0); |
| 109 |
> |
vector<unsigned int> binDof(nBins_, 0); |
| 110 |
> |
vector<unsigned int> binCount(nBins_, 0); |
| 111 |
|
|
| 112 |
|
|
| 113 |
|
for (mol = info_->beginMolecule(mi); mol != NULL; |
| 120 |
|
rb->updateAtoms(); |
| 121 |
|
} |
| 122 |
|
} |
| 123 |
< |
|
| 123 |
> |
|
| 124 |
|
if (evaluator_.isDynamic()) { |
| 125 |
|
seleMan_.setSelectionSet(evaluator_.evaluate()); |
| 126 |
|
} |
| 132 |
|
|
| 133 |
|
// figure out where that object is: |
| 134 |
|
Vector3d pos = sd->getPos(); |
| 135 |
< |
currentSnapshot_->wrapVector(pos); |
| 135 |
> |
Vector3d vel = sd->getVel(); |
| 136 |
> |
RealType m = sd->getMass(); |
| 137 |
|
|
| 138 |
|
int bin = getBin(pos); |
| 128 |
– |
binCount[bin]++; |
| 139 |
|
|
| 140 |
< |
RealType m = sd->getMass(); |
| 140 |
> |
binCount[bin] += 1; |
| 141 |
> |
|
| 142 |
|
binMass[bin] += m; |
| 132 |
– |
Vector3d vel = sd->getVel(); |
| 143 |
|
binVel[bin] += vel; |
| 144 |
|
binKE[bin] += 0.5 * (m * vel.lengthSquare()); |
| 145 |
|
binDof[bin] += 3; |
| 163 |
|
} |
| 164 |
|
} |
| 165 |
|
|
| 166 |
< |
for (int i = 0; i < nBins_; i++) { |
| 166 |
> |
for (unsigned int i = 0; i < nBins_; i++) { |
| 167 |
> |
|
| 168 |
|
if (binDof[i] > 0) { |
| 169 |
|
RealType temp = 2.0 * binKE[i] / (binDof[i] * PhysicalConstants::kb * |
| 170 |
|
PhysicalConstants::energyConvert); |