/home/eoseret/qaas_runs_CPU_9468/171-148-3214/intel/CoMD/build/CoMD/CoMD/src-openmp/linkCells.c: 173 - 378
--------------------------------------------------------------------------------

173: {
174:    real_t xyz[3] = {x,y,z};
175:    
176:    // Find correct box.
177:    int iBox = getBoxFromCoord(boxes, xyz);
178:    int iOff = iBox*MAXATOMS;
179:    iOff += boxes->nAtoms[iBox];
180:    
181:    // assign values to array elements
182:    if (iBox < boxes->nLocalBoxes)
183:       atoms->nLocal++;
184:    boxes->nAtoms[iBox]++;
185:    atoms->gid[iOff] = gid;
186:    atoms->iSpecies[iOff] = iType;
187:    
188:    atoms->r[iOff][0] = x;
189:    atoms->r[iOff][1] = y;
190:    atoms->r[iOff][2] = z;
191:    
192:    atoms->p[iOff][0] = px;
193:    atoms->p[iOff][1] = py;
194:    atoms->p[iOff][2] = pz;
195: }
[...]
352:    int ix = (int)(floor((rr[0] - localMin[0])*boxes->invBoxSize[0]));
353:    int iy = (int)(floor((rr[1] - localMin[1])*boxes->invBoxSize[1]));
354:    int iz = (int)(floor((rr[2] - localMin[2])*boxes->invBoxSize[2]));
355: 
356: 
357:    // For each axis, if we are inside the local domain, make sure we get
358:    // a local link cell.  Otherwise, make sure we get a halo link cell.
359:    if (rr[0] < localMax[0]) 
360:    {
361:       if (ix == gridSize[0]) ix = gridSize[0] - 1;
362:    }
363:    else
364:       ix = gridSize[0]; // assign to halo cell
365:    if (rr[1] < localMax[1])
[...]
371:    if (rr[2] < localMax[2])
[...]
378:    return getBoxFromTuple(boxes, ix, iy, iz);
