Go to the documentation of this file.
6 #ifndef OPENMPCD_CUDA_DEVICECODE_SIMULATION_HPP
7 #define OPENMPCD_CUDA_DEVICECODE_SIMULATION_HPP
41 const Vector3D<MPCParticlePositionType>& position);
65 const Vector3D<MPCParticlePositionType>& position);
97 const unsigned int workUnitOffset,
98 const unsigned int particleCount,
99 const MPCParticlePositionType*
const gridShift_,
101 const MPCParticlePositionType*
const positions,
102 MPCParticleVelocityType*
const velocities,
103 MPCParticleVelocityType*
const velocityCorrections,
104 unsigned int*
const collisionCellIndices);
131 const unsigned int particleID,
132 const MPCParticlePositionType*
const gridShift_,
134 const MPCParticlePositionType*
const positions,
135 MPCParticleVelocityType*
const velocities,
136 MPCParticleVelocityType*
const velocityCorrections,
137 unsigned int*
const collisionCellIndices);
162 const unsigned int workUnitOffset,
163 const unsigned int particleCount,
164 const MPCParticleVelocityType*
const velocities,
165 const unsigned int*
const collisionCellIndices,
166 MPCParticleVelocityType*
const collisionCellMomenta,
167 FP*
const collisionCellMasses,
168 const FP particleMass);
179 const unsigned int collisionCellIndex,
180 const MPCParticleVelocityType*
const collisionCellMomenta,
181 const FP*
const collisionCellMasses);
213 const unsigned int workUnitOffset,
215 unsigned int*
const collisionCellParticleCounts,
216 MPCParticleVelocityType*
const collisionCellMomenta,
217 FP*
const collisionCellFrameInternalKineticEnergies,
218 FP*
const collisionCellMasses);
238 MPCParticlePositionType*
const gridShift,
239 const FP gridShiftScale,
257 const unsigned int workUnitOffset,
259 FP*
const collisionCellRotationAxes,
305 const unsigned int workUnitOffset,
306 const unsigned int particleCount,
307 MPCParticleVelocityType*
const velocities,
308 const FP particleMass,
309 const unsigned int*
const collisionCellIndices,
310 const MPCParticleVelocityType*
const collisionCellMomenta,
311 const FP*
const collisionCellMasses,
312 const MPCParticlePositionType*
const collisionCellRotationAxes,
313 FP*
const collisionCellFrameInternalKineticEnergies,
314 unsigned int*
const collisionCellParticleCounts);
339 const unsigned int workUnitOffset,
341 const FP*
const collisionCellFrameInternalKineticEnergies,
342 unsigned int*
const collisionCellParticleCounts,
343 FP*
const collisionCellRelativeVelocityScalings,
344 const FP bulkThermostatTargetkT,
376 const unsigned int workUnitOffset,
377 const unsigned int particleCount,
378 MPCParticleVelocityType*
const velocities,
379 const unsigned int*
const collisionCellIndices,
380 const MPCParticleVelocityType*
const collisionCellMomenta,
381 const FP*
const collisionCellMasses,
382 const FP*
const collisionCellVelocityScalings);
399 const unsigned int workUnitOffset,
400 const unsigned int particleCount,
401 MPCParticleVelocityType*
const velocities,
402 const MPCParticleVelocityType*
const velocityCorrections);
424 const std::size_t count,
426 const unsigned long long seed);
__global__ void generateGridShiftVector(MPCParticlePositionType *const gridShift, const FP gridShiftScale, GPURNG *const rngs)
Generates a new random grid shift vector.
__global__ void generateCollisionCellRotationAxes(const unsigned int workUnitOffset, const unsigned int collisionCellCount, FP *const collisionCellRotationAxes, GPURNG *const rngs)
Generates new rotation axes for the collision cells.
__global__ void undoLeesEdwardsVelocityCorrections(const unsigned int workUnitOffset, const unsigned int particleCount, MPCParticleVelocityType *const velocities, const MPCParticleVelocityType *const velocityCorrections)
Undoes the velocity corrections applied by sortIntoCollisionCellsLeesEdwards.
__global__ void collisionCellStochasticRotationStep1(const unsigned int workUnitOffset, const unsigned int particleCount, MPCParticleVelocityType *const velocities, const FP particleMass, const unsigned int *const collisionCellIndices, const MPCParticleVelocityType *const collisionCellMomenta, const FP *const collisionCellMasses, const MPCParticlePositionType *const collisionCellRotationAxes, FP *const collisionCellFrameInternalKineticEnergies, unsigned int *const collisionCellParticleCounts)
Applies the first step of the SRD rotation to the given particles.
__global__ void destroyGPURNGs(const std::size_t count, GPURNG *const location)
Destroys instances of GPURNG in the specified memory location.
__global__ void sortParticlesIntoCollisionCellsLeesEdwards(const unsigned int workUnitOffset, const unsigned int particleCount, const MPCParticlePositionType *const gridShift_, const FP mpcTime, const MPCParticlePositionType *const positions, MPCParticleVelocityType *const velocities, MPCParticleVelocityType *const velocityCorrections, unsigned int *const collisionCellIndices)
Sorts the MPC particles into the collision cells, temporarily applying Lees-Edwards boundary conditio...
__global__ void collisionCellStochasticRotationStep2(const unsigned int workUnitOffset, const unsigned int particleCount, MPCParticleVelocityType *const velocities, const unsigned int *const collisionCellIndices, const MPCParticleVelocityType *const collisionCellMomenta, const FP *const collisionCellMasses, const FP *const collisionCellVelocityScalings)
Applies the second step of the SRD rotation to the given particles.
__global__ void resetCollisionCellData(const unsigned int workUnitOffset, const unsigned int collisionCellCount, unsigned int *const collisionCellParticleCounts, MPCParticleVelocityType *const collisionCellMomenta, FP *const collisionCellFrameInternalKineticEnergies, FP *const collisionCellMasses)
Resets the collision cell data buffers.
__device__ void sortIntoCollisionCellsLeesEdwards(const unsigned int particleID, const MPCParticlePositionType *const gridShift_, const FP mpcTime, const MPCParticlePositionType *const positions, MPCParticleVelocityType *const velocities, MPCParticleVelocityType *const velocityCorrections, unsigned int *const collisionCellIndices)
Sorts the given particle into the collision cells, temporarily applying Lees-Edwards boundary conditi...
__constant__ unsigned int collisionCellCount
The number of collision cells in the system.
__device__ unsigned int getCollisionCellIndex(const Vector3D< MPCParticlePositionType > &position)
Returns the collision cell index for the given position.
Random::Generators::Philox4x32_10 GPURNG
The random number generator type for GPUs.
__global__ void constructGPURNGs(const std::size_t count, GPURNG *const location, const unsigned long long seed)
Sets up instances of GPURNG in the specified memory location.
__global__ void generateCollisionCellMBSFactors(const unsigned int workUnitOffset, const unsigned int collisionCellCount, const FP *const collisionCellFrameInternalKineticEnergies, unsigned int *const collisionCellParticleCounts, FP *const collisionCellRelativeVelocityScalings, const FP bulkThermostatTargetkT, GPURNG *const rngs)
Generates Maxwell-Boltzmann-Scaling factors for the collision cells.
__device__ Vector3D< MPCParticleVelocityType > getCollisionCellCenterOfMassVelocity(const unsigned int collisionCellIndex, const MPCParticleVelocityType *const collisionCellMomenta, const FP *const collisionCellMasses)
Returns the center-of-mass velocity of a collision cell.
__device__ bool isInPrimarySimulationVolume(const Vector3D< MPCParticlePositionType > &position)
Returns whether the given position lies within the primary simulation volume.
__global__ void collisionCellContributions(const unsigned int workUnitOffset, const unsigned int particleCount, const MPCParticleVelocityType *const velocities, const unsigned int *const collisionCellIndices, MPCParticleVelocityType *const collisionCellMomenta, FP *const collisionCellMasses, const FP particleMass)
Computes the collision cell mass and momentum contributions by the given particles.