OpenMPCD
DeviceCode/Doublets.hpp
Go to the documentation of this file.
1 /**
2  * @file
3  * Defines CUDA Device code for MPC fluids consisting out of MPC-particle doublets.
4  */
5 
6 #ifndef OPENMPCD_CUDA_MPCFLUID_DEVICECODE_DOUBLETS_HPP
7 #define OPENMPCD_CUDA_MPCFLUID_DEVICECODE_DOUBLETS_HPP
8 
9 #include <OpenMPCD/Types.hpp>
10 #include <OpenMPCD/Vector3D.hpp>
11 
12 namespace OpenMPCD
13 {
14 namespace CUDA
15 {
16 namespace MPCFluid
17 {
18 namespace DeviceCode
19 {
20  /**
21  * Saves the center-of-mass velocities of the MPC fluid's doublets to the given buffer.
22  * @param[in] mpcParticleCount The number of individual MPC fluid particles.
23  * @param[in] velocities The Device array of MPC fluid particle velocities.
24  * @param[out] comVelocities Device buffer where the center-of-mass velocities are saved.
25  */
27  const unsigned int mpcParticleCount,
28  const MPCParticleVelocityType* const velocities,
29  MPCParticleVelocityType* const comVelocities);
30 
31  /**
32  * Saves the center-of-mass velocities of the MPC fluid's doublets to the given buffer.
33  * @param[in] workUnitOffset The number of trimers to skip.
34  * @param[in] velocities The array of MPC fluid particle velocities.
35  * @param[out] comVelocities Buffer where the center-of-mass velocities are saved.
36  */
38  const unsigned int workUnitOffset,
39  const MPCParticleVelocityType* const velocities,
40  MPCParticleVelocityType* const comVelocities);
41 
42  /**
43  * Returns the center-of-mass velocity of for the given doublet.
44  * This function assumes that both constituents have the same mass.
45  * @param[in] doubletID The ID of the doublet.
46  * @param[in] velocities The array of MPC fluid particle velocities.
47  */
48  __device__ Vector3D<MPCParticleVelocityType> getCenterOfMassVelocity_doublet(
49  const unsigned int doubletID,
50  const MPCParticleVelocityType* const velocities);
51 } //namespace DeviceCode
52 } //namespace MPCFluid
53 } //namespace CUDA
54 } //namespace OpenMPCD
55 
56 #endif
OpenMPCD::CUDA::MPCFluid::DeviceCode::getCenterOfMassVelocities_doublet
void getCenterOfMassVelocities_doublet(const unsigned int mpcParticleCount, const MPCParticleVelocityType *const velocities, MPCParticleVelocityType *const comVelocities)
Saves the center-of-mass velocities of the MPC fluid's doublets to the given buffer.
OpenMPCD::CUDA::MPCFluid::DeviceCode::getCenterOfMassVelocity_doublet
__device__ Vector3D< MPCParticleVelocityType > getCenterOfMassVelocity_doublet(const unsigned int doubletID, const MPCParticleVelocityType *const velocities)
Returns the center-of-mass velocity of for the given doublet.
OpenMPCD::CUDA::MPCFluid::DeviceCode::mpcParticleCount
__constant__ unsigned int mpcParticleCount
The number of MPC fluid particles.
OpenMPCD::CUDA::MPCFluid::DeviceCode::getCenterOfMassVelocities_doublet_kernel
__global__ void getCenterOfMassVelocities_doublet_kernel(const unsigned int workUnitOffset, const MPCParticleVelocityType *const velocities, MPCParticleVelocityType *const comVelocities)
Saves the center-of-mass velocities of the MPC fluid's doublets to the given buffer.
Vector3D.hpp
Types.hpp