| 1 |
+ |
#define _LARGEFILE_SOURCE64 |
| 2 |
|
#define _FILE_OFFSET_BITS 64 |
| 3 |
|
|
| 4 |
|
#include <string.h> |
| 96 |
|
indexArray.push_back(make_pair(i, atoms[i]->getGlobalIndex())); |
| 97 |
|
|
| 98 |
|
sort(indexArray.begin(), indexArray.end(), indexSortingCriterion); |
| 98 |
– |
|
| 99 |
– |
//for (int i = 0; i < mpiSim->getMyNlocal(); i++) { |
| 100 |
– |
// printf("node %d has global %d at local %d\n", worldRank, indexArray[i].second, indexArray[i].first); |
| 101 |
– |
//} |
| 102 |
– |
|
| 99 |
|
} |
| 100 |
|
|
| 101 |
|
#endif |
| 106 |
|
vector<ofstream*> fileStreams; |
| 107 |
|
|
| 108 |
|
#ifdef IS_MPI |
| 113 |
– |
printf("Hello from node %d\n", worldRank); |
| 114 |
– |
sortByGlobalIndex(); |
| 109 |
|
if(worldRank == 0 ){ |
| 110 |
< |
|
| 110 |
> |
#endif |
| 111 |
|
finalOut.open( entry_plug->finalName, ios::out | ios::trunc ); |
| 112 |
|
if( !finalOut ){ |
| 113 |
|
sprintf( painCave.errMsg, |
| 116 |
|
painCave.isFatal = 1; |
| 117 |
|
simError(); |
| 118 |
|
} |
| 119 |
+ |
#ifdef IS_MPI |
| 120 |
|
} |
| 121 |
|
#endif // is_mpi |
| 122 |
|
|
| 227 |
|
int nAtoms = entry_plug->n_atoms; |
| 228 |
|
#endif //is_mpi |
| 229 |
|
|
| 230 |
< |
double q[4]; |
| 230 |
> |
double q[4], ji[3]; |
| 231 |
|
DirectionalAtom* dAtom; |
| 232 |
|
Atom** atoms = entry_plug->atoms; |
| 233 |
|
double pos[3], vel[3]; |
| 274 |
|
|
| 275 |
|
dAtom = (DirectionalAtom *)atoms[i]; |
| 276 |
|
dAtom->getQ( q ); |
| 277 |
+ |
dAtom->getJ( ji ); |
| 278 |
|
|
| 279 |
|
sprintf( tempBuffer, |
| 280 |
|
"%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\n", |
| 282 |
|
q[1], |
| 283 |
|
q[2], |
| 284 |
|
q[3], |
| 285 |
< |
dAtom->getJx(), |
| 286 |
< |
dAtom->getJy(), |
| 287 |
< |
dAtom->getJz()); |
| 285 |
> |
ji[0], |
| 286 |
> |
ji[1], |
| 287 |
> |
ji[2]); |
| 288 |
|
strcat( writeLine, tempBuffer ); |
| 289 |
|
} |
| 290 |
|
else |
| 391 |
|
|
| 392 |
|
haveError = 0; |
| 393 |
|
which_atom = i; |
| 398 |
– |
|
| 399 |
– |
//local_index = -1; |
| 400 |
– |
|
| 401 |
– |
//for (j=0; (j<mpiSim->getMyNlocal()) && (local_index < 0); j++) { |
| 402 |
– |
// if (atoms[j]->getGlobalIndex() == which_atom) local_index = j; |
| 403 |
– |
//} |
| 394 |
|
|
| 405 |
– |
//if (local_index != -1) { |
| 406 |
– |
|
| 395 |
|
local_index = indexArray[currentIndex].first; |
| 396 |
|
|
| 397 |
|
if (which_atom == indexArray[currentIndex].second) { |
| 417 |
|
|
| 418 |
|
dAtom = (DirectionalAtom *)atoms[local_index]; |
| 419 |
|
dAtom->getQ( q ); |
| 420 |
+ |
dAtom->getJ( ji ); |
| 421 |
|
|
| 422 |
|
for (int j = 0; j < 6 ; j++) |
| 423 |
|
atomData13[j] = atomData6[j]; |
| 427 |
|
atomData13[8] = q[2]; |
| 428 |
|
atomData13[9] = q[3]; |
| 429 |
|
|
| 430 |
< |
atomData13[10] = dAtom->getJx(); |
| 431 |
< |
atomData13[11] = dAtom->getJy(); |
| 432 |
< |
atomData13[12] = dAtom->getJz(); |
| 430 |
> |
atomData13[10] = ji[0]; |
| 431 |
> |
atomData13[11] = ji[1]; |
| 432 |
> |
atomData13[12] = ji[2]; |
| 433 |
|
} |
| 434 |
|
|
| 435 |
|
} else { |
| 521 |
|
} |
| 522 |
|
which_atom = i; |
| 523 |
|
|
| 535 |
– |
//local_index = -1; |
| 536 |
– |
|
| 537 |
– |
//for (j=0; (j<mpiSim->getMyNlocal()) && (local_index < 0); j++) { |
| 538 |
– |
// if (atoms[j]->getGlobalIndex() == which_atom) local_index = j; |
| 539 |
– |
//} |
| 540 |
– |
|
| 541 |
– |
//if (local_index != -1) { |
| 542 |
– |
|
| 524 |
|
local_index = indexArray[currentIndex].first; |
| 525 |
|
|
| 526 |
|
if (which_atom == indexArray[currentIndex].second) { |
| 546 |
|
|
| 547 |
|
dAtom = (DirectionalAtom *)atoms[local_index]; |
| 548 |
|
dAtom->getQ( q ); |
| 549 |
+ |
dAtom->getJ( ji ); |
| 550 |
|
|
| 551 |
|
for (int j = 0; j < 6 ; j++) |
| 552 |
|
atomData13[j] = atomData6[j]; |
| 556 |
|
atomData13[8] = q[2]; |
| 557 |
|
atomData13[9] = q[3]; |
| 558 |
|
|
| 559 |
< |
atomData13[10] = dAtom->getJx(); |
| 560 |
< |
atomData13[11] = dAtom->getJy(); |
| 561 |
< |
atomData13[12] = dAtom->getJz(); |
| 559 |
> |
atomData13[10] = ji[0]; |
| 560 |
> |
atomData13[11] = ji[1]; |
| 561 |
> |
atomData13[12] = ji[2]; |
| 562 |
|
} |
| 563 |
|
|
| 564 |
|
} else { |