integrationUtilities.cl 526 Bytes
Newer Older
1
2
3
4
5
6
7
/**
 * Apply a time shift to the velocities before computing kinetic energy.
 */
__kernel void timeShiftVelocities(__global mixed4* restrict velm, __global const real4* restrict force, real timeShift) {
    for (int index = get_global_id(0); index < NUM_ATOMS; index += get_global_size(0)) {
        mixed4 velocity = velm[index];
        if (velocity.w != 0.0) {
8
9
            mixed4 f = convert_mixed4(force[index]);
            velocity.xyz += timeShift*f.xyz*velocity.w;
10
11
12
13
            velm[index] = velocity;
        }
    }
}