Demo entry 6350236

advance-velocity-omp-real

   

Submitted by anonymous on Mar 09, 2017 at 00:04
Language: C. Code size: 422 Bytes.

void advanceVelocity(SimFlat* s, int nBoxes, real_t dt)
{
   #pragma omp parallel for
   for (int iBox=0; iBox<nBoxes; iBox++)
   {
      for (int iOff=MAXATOMS*iBox,ii=0; ii<s->boxes->nAtoms[iBox]; ii++,iOff++)
      {
         s->atoms->p[iOff][0] += dt*s->atoms->f[iOff][0];
         s->atoms->p[iOff][1] += dt*s->atoms->f[iOff][1];
         s->atoms->p[iOff][2] += dt*s->atoms->f[iOff][2];
      }
   }
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).