| 281 |
|
// do some sanity checking |
| 282 |
|
|
| 283 |
|
int selectionCount = seleMan_.getSelectionCount(); |
| 284 |
+ |
|
| 285 |
|
int nIntegrable = info->getNGlobalIntegrableObjects(); |
| 286 |
|
|
| 287 |
|
if (selectionCount > nIntegrable) { |
| 452 |
|
|
| 453 |
|
int selei; |
| 454 |
|
StuntDouble* sd; |
| 454 |
– |
int idx; |
| 455 |
|
|
| 456 |
|
RealType min_val; |
| 457 |
|
bool min_found = false; |
| 463 |
|
|
| 464 |
|
for (sd = seleMan_.beginSelected(selei); sd != NULL; |
| 465 |
|
sd = seleMan_.nextSelected(selei)) { |
| 466 |
– |
|
| 467 |
– |
idx = sd->getLocalIndex(); |
| 466 |
|
|
| 467 |
|
Vector3d pos = sd->getPos(); |
| 468 |
|
|
| 541 |
|
} |
| 542 |
|
} |
| 543 |
|
|
| 544 |
< |
#ifdef IS_MPI |
| 545 |
< |
int nProc, worldRank; |
| 544 |
> |
#ifdef IS_MPI |
| 545 |
> |
int worldRank = MPI::COMM_WORLD.Get_rank(); |
| 546 |
|
|
| 549 |
– |
nProc = MPI::COMM_WORLD.Get_size(); |
| 550 |
– |
worldRank = MPI::COMM_WORLD.Get_rank(); |
| 551 |
– |
|
| 547 |
|
bool my_min_found = min_found; |
| 548 |
|
bool my_max_found = max_found; |
| 549 |
|
|
| 776 |
|
|
| 777 |
|
int selei; |
| 778 |
|
StuntDouble* sd; |
| 784 |
– |
int idx; |
| 779 |
|
|
| 780 |
|
vector<StuntDouble*> hotBin, coldBin; |
| 781 |
|
|
| 797 |
|
for (sd = seleMan_.beginSelected(selei); sd != NULL; |
| 798 |
|
sd = seleMan_.nextSelected(selei)) { |
| 799 |
|
|
| 806 |
– |
idx = sd->getLocalIndex(); |
| 807 |
– |
|
| 800 |
|
Vector3d pos = sd->getPos(); |
| 801 |
|
|
| 802 |
|
// wrap the stuntdouble's position back into the box: |
| 909 |
|
|
| 910 |
|
if ((c > 0.81) && (c < 1.21)) {//restrict scaling coefficients |
| 911 |
|
c = sqrt(c); |
| 912 |
< |
//std::cerr << "cold slab scaling coefficient: " << c << endl; |
| 921 |
< |
//now convert to hotBin coefficient |
| 912 |
> |
|
| 913 |
|
RealType w = 0.0; |
| 914 |
|
if (rnemdFluxType_ == rnemdFullKE) { |
| 915 |
|
x = 1.0 + px * (1.0 - c); |
| 947 |
|
} |
| 948 |
|
} |
| 949 |
|
w = sqrt(w); |
| 959 |
– |
// std::cerr << "xh= " << x << "\tyh= " << y << "\tzh= " << z |
| 960 |
– |
// << "\twh= " << w << endl; |
| 950 |
|
for (sdi = hotBin.begin(); sdi != hotBin.end(); sdi++) { |
| 951 |
|
if (rnemdFluxType_ == rnemdFullKE) { |
| 952 |
|
vel = (*sdi)->getVel(); |
| 1220 |
|
|
| 1221 |
|
int selei; |
| 1222 |
|
StuntDouble* sd; |
| 1234 |
– |
int idx; |
| 1223 |
|
|
| 1224 |
|
vector<StuntDouble*> hotBin, coldBin; |
| 1225 |
|
|
| 1234 |
|
for (sd = seleMan_.beginSelected(selei); sd != NULL; |
| 1235 |
|
sd = seleMan_.nextSelected(selei)) { |
| 1236 |
|
|
| 1249 |
– |
idx = sd->getLocalIndex(); |
| 1250 |
– |
|
| 1237 |
|
Vector3d pos = sd->getPos(); |
| 1238 |
|
|
| 1239 |
|
// wrap the stuntdouble's position back into the box: |
| 1252 |
|
|
| 1253 |
|
if (inA) { |
| 1254 |
|
hotBin.push_back(sd); |
| 1269 |
– |
//std::cerr << "before, velocity = " << vel << endl; |
| 1255 |
|
Ph += mass * vel; |
| 1271 |
– |
//std::cerr << "after, velocity = " << vel << endl; |
| 1256 |
|
Mh += mass; |
| 1257 |
|
Kh += mass * vel.lengthSquare(); |
| 1258 |
|
if (rnemdFluxType_ == rnemdFullKE) { |
| 1300 |
|
|
| 1301 |
|
Kh *= 0.5; |
| 1302 |
|
Kc *= 0.5; |
| 1319 |
– |
|
| 1320 |
– |
// std::cerr << "Mh= " << Mh << "\tKh= " << Kh << "\tMc= " << Mc |
| 1321 |
– |
// << "\tKc= " << Kc << endl; |
| 1322 |
– |
// std::cerr << "Ph= " << Ph << "\tPc= " << Pc << endl; |
| 1303 |
|
|
| 1304 |
|
#ifdef IS_MPI |
| 1305 |
|
MPI::COMM_WORLD.Allreduce(MPI::IN_PLACE, &Ph[0], 3, MPI::REALTYPE, MPI::SUM); |
| 1331 |
|
if (hDenominator > 0.0) { |
| 1332 |
|
RealType h = sqrt(hNumerator / hDenominator); |
| 1333 |
|
if ((h > 0.9) && (h < 1.1)) { |
| 1334 |
< |
// std::cerr << "cold slab scaling coefficient: " << c << "\n"; |
| 1355 |
< |
// std::cerr << "hot slab scaling coefficient: " << h << "\n"; |
| 1334 |
> |
|
| 1335 |
|
vector<StuntDouble*>::iterator sdi; |
| 1336 |
|
Vector3d vel; |
| 1337 |
|
for (sdi = coldBin.begin(); sdi != coldBin.end(); sdi++) { |
| 1406 |
|
|
| 1407 |
|
seleMan_.setSelectionSet(evaluator_.evaluate()); |
| 1408 |
|
|
| 1409 |
< |
int selei; |
| 1409 |
> |
int selei(0); |
| 1410 |
|
StuntDouble* sd; |
| 1432 |
– |
int idx; |
| 1411 |
|
|
| 1412 |
|
vector<RealType> binMass(nBins_, 0.0); |
| 1413 |
|
vector<RealType> binPx(nBins_, 0.0); |
| 1431 |
|
sd != NULL; |
| 1432 |
|
sd = mol->nextIntegrableObject(iiter)) |
| 1433 |
|
*/ |
| 1434 |
+ |
|
| 1435 |
|
for (sd = seleMan_.beginSelected(selei); sd != NULL; |
| 1436 |
< |
sd = seleMan_.nextSelected(selei)) { |
| 1437 |
< |
|
| 1459 |
< |
idx = sd->getLocalIndex(); |
| 1460 |
< |
|
| 1436 |
> |
sd = seleMan_.nextSelected(selei)) { |
| 1437 |
> |
|
| 1438 |
|
Vector3d pos = sd->getPos(); |
| 1439 |
|
|
| 1440 |
|
// wrap the stuntdouble's position back into the box: |
| 1449 |
|
// The modulo operator is used to wrap the case when we are |
| 1450 |
|
// beyond the end of the bins back to the beginning. |
| 1451 |
|
int binNo = int(nBins_ * (pos.z() / hmat(2,2) + 0.5)) % nBins_; |
| 1452 |
< |
|
| 1452 |
> |
|
| 1453 |
|
RealType mass = sd->getMass(); |
| 1454 |
|
Vector3d vel = sd->getVel(); |
| 1455 |
|
|
| 1480 |
|
} |
| 1481 |
|
} |
| 1482 |
|
|
| 1506 |
– |
|
| 1483 |
|
#ifdef IS_MPI |
| 1484 |
|
MPI::COMM_WORLD.Allreduce(MPI::IN_PLACE, &binCount[0], |
| 1485 |
|
nBins_, MPI::INT, MPI::SUM); |
| 1512 |
|
|
| 1513 |
|
temp = 2.0 * binKE[i] / (binDOF[i] * PhysicalConstants::kb * |
| 1514 |
|
PhysicalConstants::energyConvert); |
| 1515 |
< |
|
| 1515 |
> |
|
| 1516 |
|
for (unsigned int j = 0; j < outputMask_.size(); ++j) { |
| 1517 |
|
if(outputMask_[j]) { |
| 1518 |
|
switch(j) { |