/home/eoseret/qaas_runs_CPU_9468/171-148-3214/intel/CoMD/build/CoMD/CoMD/src-openmp/haloExchange.c: 362 - 394
--------------------------------------------------------------------------------

362: {
363:    AtomExchangeParms* parms = (AtomExchangeParms*) vparms;
364:    SimFlat* s = (SimFlat*) data;
365:    AtomMsg* buf = (AtomMsg*) charBuf;
366:    
367:    real_t* pbcFactor = parms->pbcFactor[face];
368:    real3 shift;
369:    shift[0] = pbcFactor[0] * s->domain->globalExtent[0];
370:    shift[1] = pbcFactor[1] * s->domain->globalExtent[1];
371:    shift[2] = pbcFactor[2] * s->domain->globalExtent[2];
372:    
373:    int nCells = parms->nCells[face];
374:    int* cellList = parms->cellList[face];
375:    int nBuf = 0;
376:    for (int iCell=0; iCell<nCells; ++iCell)
377:    {
378:       int iBox = cellList[iCell];
379:       int iOff = iBox*MAXATOMS;
380:       for (int ii=iOff; ii<iOff+s->boxes->nAtoms[iBox]; ++ii)
381:       {
382:          buf[nBuf].gid  = s->atoms->gid[ii];
383:          buf[nBuf].type = s->atoms->iSpecies[ii];
384:          buf[nBuf].rx = s->atoms->r[ii][0] + shift[0];
385:          buf[nBuf].ry = s->atoms->r[ii][1] + shift[1];
386:          buf[nBuf].rz = s->atoms->r[ii][2] + shift[2];
387:          buf[nBuf].px = s->atoms->p[ii][0];
388:          buf[nBuf].py = s->atoms->p[ii][1];
389:          buf[nBuf].pz = s->atoms->p[ii][2];
390:          ++nBuf;
391:       }
392:    }
393:    return nBuf*sizeof(AtomMsg);
394: }
