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. |
The Leap Frog integrator is a variant of the Velocity Verlet integrator.
__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 by averaging the velocites at
and
.
[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 |
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.
[in,out] | dVel | Particle velocity array |
[in] | dForce | Particle force array |
[in] | N | Number of particles |
[in] | dt | Time increment |
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
then it is used to calculate the new positions at timte
Finally, we check the periodic bounds and shift the particles accordingly.
[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 |
Definition at line 24 of file gpu_integrator.cu.
References checkPBC().