| 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 | 
| 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 | 
| 392 | 
  | 
        haveError = 0; | 
| 393 | 
  | 
        which_atom = i; | 
| 394 | 
  | 
         | 
| 398 | 
– | 
        //local_index = -1; | 
| 399 | 
– | 
 | 
| 400 | 
– | 
        //for (j=0; (j<mpiSim->getMyNlocal()) && (local_index < 0); j++) { | 
| 401 | 
– | 
        //  if (atoms[j]->getGlobalIndex() == which_atom) local_index = j; | 
| 402 | 
– | 
        //} | 
| 403 | 
– | 
         | 
| 404 | 
– | 
        //if (local_index != -1) { | 
| 405 | 
– | 
           | 
| 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 | 
  | 
 | 
| 534 | 
– | 
        //local_index = -1; | 
| 535 | 
– | 
 | 
| 536 | 
– | 
        //for (j=0; (j<mpiSim->getMyNlocal()) && (local_index < 0); j++) { | 
| 537 | 
– | 
        // if (atoms[j]->getGlobalIndex() == which_atom) local_index = j; | 
| 538 | 
– | 
        //} | 
| 539 | 
– | 
         | 
| 540 | 
– | 
        //if (local_index != -1) { | 
| 541 | 
– | 
 | 
| 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 { |