Leap Frog
[Integrators]

Functions

__global__ void gpuGetVelOnTime (FLOAT_ARRAY_TYPE *dVel, FLOAT_ARRAY_TYPE *dVt, FLOAT_ARRAY_TYPE *dForce, int N, float dt)
 Calculates velocities on timestep.
__global__ void gpuInitialBackstep (FLOAT_ARRAY_TYPE *dVel, FLOAT_ARRAY_TYPE *dForce, int N, float dt)
 Inital backstep.
__global__ void gpuIntegratorLeapFrog (FLOAT_ARRAY_TYPE *dPos, FLOAT_ARRAY_TYPE *dVel, FLOAT_ARRAY_TYPE *dForce, int N, float dt, float boxSize, float *dmax, float maxDisplacement, bool *needListUpdate)
 Leap Frog integrator.

Detailed Description

The Leap Frog integrator is a variant of the Velocity Verlet integrator.


Function Documentation

__global__ void gpuGetVelOnTime ( FLOAT_ARRAY_TYPE *  dVel,
FLOAT_ARRAY_TYPE *  dVt,
FLOAT_ARRAY_TYPE *  dForce,
int  N,
float  dt 
)

When using the Leap Frog integrator, the velocites are calculated only on half-timesteps. For consistent output of positions and velocites this function calculates the mean velocity on time $n$ by averaging the velocites at $n-\frac{1}{2}$ and $n+\frac{1}{2}$ .

Parameters:
[in] dVel Velocities on half-step
[out] dVt Velocties on step
[in] dForce Forces on step
[in] N Number of particles
[in] dt time increment
Returns:
Returns CUDA error information

Definition at line 238 of file gpu_tools.cu.

__global__ void gpuInitialBackstep ( FLOAT_ARRAY_TYPE *  dVel,
FLOAT_ARRAY_TYPE *  dForce,
int  N,
float  dt 
)

This function is called at the beginning of a simulation where the Leap Frog integrator is used. It generates from the forces at the initial time the velocities half a step backwards in time.

Parameters:
[in,out] dVel Particle velocity array
[in] dForce Particle force array
[in] N Number of particles
[in] dt Time increment
Returns:
Returns CUDA error information.

Definition at line 53 of file gpu_integrator.cu.

__global__ void gpuIntegratorLeapFrog ( FLOAT_ARRAY_TYPE *  dPos,
FLOAT_ARRAY_TYPE *  dVel,
FLOAT_ARRAY_TYPE *  dForce,
int  N,
float  dt,
float  boxSize,
float *  dmax,
float  maxDisplacement,
bool *  needListUpdate 
)

The integration of Newtons equation of motions is done in two steps: First we calculate the velocity at intermediate time $ n+\frac{1}{2} $

\[ \vec{v}(n+\frac{1}{2}) = \vec{v}(n-\frac{1}{2})+\tau\vec{a}(n)\label{verlet1} \]

then it is used to calculate the new positions at timte $ n+1 $

\[ \vec{x}(n+1) = \vec{x}(n) + \tau\vec{v}(n+\frac{1}{2})\label{verlet2} \]

Finally, we check the periodic bounds and shift the particles accordingly.

Parameters:
[in,out] dPos Particle position array
[in,out] dVel Particle velocity array
[in] dForce Particle force array
[in] N Number of particles
[in] dt Time increment
[in] boxSize Edge length of the cubic simulation box.
[in,out] dmax List to store the displacement of each particle
[in] maxDisplacement Maximum allowed displacement
[out] needListUpdate Flag which is set when a particle's displacement reached the threshold
Returns:
Returns CUDA error information.

Definition at line 24 of file gpu_integrator.cu.

References checkPBC().

 All Files Functions Defines

Generated on Thu Jun 17 14:22:54 2010 for mdgpu - a molecular dynamic simulation program using GPUs by  doxygen 1.6.1