Functions | |
__host__ __device__ void | checkPBC (FLOAT_ARRAY_TYPE *pos, float *boxSize) |
Confine a particle into the simulation box according to the periodic boundary conditions. | |
__device__ void | gpuDistPBC (FLOAT_ARRAY_TYPE *dDist, FLOAT_ARRAY_TYPE *dA, FLOAT_ARRAY_TYPE *dB, float *boxSize) |
Calculates particle distance according to the nearest image convention. |
This module contains all functions related to periodic boundary conditions.
__host__ __device__ void checkPBC | ( | FLOAT_ARRAY_TYPE * | pos, | |
float * | boxSize | |||
) | [inline] |
If a particle has its postion pos
outside the simulation box, it is replaced into the box according to the periodic boundary conditions.
The function is callable and executable either on the device or host.
[in,out] | pos | Particle position (either on host or device) |
[in] | boxSize | Edge length of the cubic simulation box |
Definition at line 154 of file gpu_tools.cuh.
Referenced by gpuIntegratorLeapFrog().
__device__ void gpuDistPBC | ( | FLOAT_ARRAY_TYPE * | dDist, | |
FLOAT_ARRAY_TYPE * | dA, | |||
FLOAT_ARRAY_TYPE * | dB, | |||
float * | boxSize | |||
) |
Given the positions of particles dA
and dB
in device memory, the distance according to the nearest image convention is given back in dDist
.
[out] | dDist | Resulting distance between particle dA and dB |
[in] | dA | Position of particle dA |
[in] | dB | Position of particle dB |
[in] | boxSize | Edge length of the cubic simulation box |
Definition at line 131 of file gpu_tools.cuh.
References gpuRnd().
Referenced by gpuAddHarmonicBondForce(), gpuAddLJForce(), gpuAddLJForceCut(), gpuGenerateVerletList(), gpuGenerateVerletListSmem(), gpuGenerateVerletListSmemVar1(), gpuGenerateVerletListVar1(), gpuGetHarmonicPotentialEnergyKernel(), and gpuLJCutPotentialEnergyKernel().