OpenMPCD
|
Contains CUDA Device code. More...
Functions | |
void | setMPCParticleCountSymbol (const unsigned int count) |
Sets the symbol mpcParticleCount. More... | |
__global__ void | computeLogicalEntityCentersOfMass (const unsigned int workUnitOffset, const MPCParticlePositionType *const positions, const unsigned int numberOfLogicalEntities, const unsigned int particlesPerLogicalEntity, MPCParticlePositionType *const output) |
Computes the center of mass of logical entities, where each logical entity has a common number of constituent particles, each having the same mass. More... | |
void | getCenterOfMassVelocities_chain (const unsigned int mpcParticleCount, const unsigned int chainLength, const MPCParticleVelocityType *const velocities, MPCParticleVelocityType *const comVelocities) |
Saves the center-of-mass velocities of the MPC fluid's chains to the given buffer. More... | |
__global__ void | getCenterOfMassVelocities_chain_kernel (const unsigned int workUnitOffset, const unsigned int chainLength, const MPCParticleVelocityType *const velocities, MPCParticleVelocityType *const comVelocities) |
Saves the center-of-mass velocities of the MPC fluid's chains to the given buffer. More... | |
__device__ Vector3D< MPCParticleVelocityType > | getCenterOfMassVelocity_chain (const unsigned int chainID, const unsigned int chainLength, const MPCParticleVelocityType *const velocities) |
Returns the center-of-mass velocity of for the given chain. More... | |
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. More... | |
__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. More... | |
__device__ Vector3D< MPCParticleVelocityType > | getCenterOfMassVelocity_doublet (const unsigned int doubletID, const MPCParticleVelocityType *const velocities) |
Returns the center-of-mass velocity of for the given doublet. More... | |
__device__ void | streamGaussianChainVelocityVerlet (const unsigned int particle1ID, MPCParticlePositionType *const positions, MPCParticleVelocityType *const velocities, FP *const accelerationBuffer, const unsigned int particlesPerChain, const FP reducedSpringConstant, const FP timestep, const unsigned int stepCount) |
Streams the given Gaussian Chain by applying the velocity-Verlet algorithm. More... | |
__global__ void | streamGaussianChainsVelocityVerlet (const unsigned int workUnitOffset, MPCParticlePositionType *const positions, MPCParticleVelocityType *const velocities, FP *const accelerationBuffer, const unsigned int particlesPerChain, const FP reducedSpringConstant, const FP timestep, const unsigned int stepCount) |
Streams the dumbbells by applying the velocity-Verlet algorithm. More... | |
const __device__ Vector3D< FP > | getAccelerationGaussianChainVelocityVerlet (MPCParticlePositionType *const positions, const unsigned int firstParticleID, const unsigned int particleID, const unsigned int lastParticleID, const FP reducedSpringConstant, const FP timestep) |
Computes the acceleration experienced by the given particle in the Gaussian Chain. More... | |
void | setGaussianDumbbellSymbols (const FP omega_, const FP timestep) |
Sets the constant symbols. More... | |
__device__ void | streamDumbbellAnalytically (const unsigned int particle1ID, MPCParticlePositionType *const positions, MPCParticleVelocityType *const velocities) |
Streams the given dumbbell by applying the analytical solution of the equations of motion. More... | |
__global__ void | streamDumbbellsAnalytically (const unsigned int workUnitOffset, MPCParticlePositionType *const positions, MPCParticleVelocityType *const velocities) |
Streams the dumbbells by applying the analytical solution of the equations of motion. More... | |
__device__ void | streamDumbbellVelocityVerlet (const unsigned int particle1ID, MPCParticlePositionType *const positions, MPCParticleVelocityType *const velocities, const FP reducedSpringConstant, const FP timestep, const unsigned int stepCount) |
Streams the given dumbbell by applying the velocity-Verlet algorithm. More... | |
__global__ void | streamDumbbellsVelocityVerlet (const unsigned int workUnitOffset, MPCParticlePositionType *const positions, MPCParticleVelocityType *const velocities, const FP reducedSpringConstant, const FP timestep, const unsigned int stepCount) |
Streams the dumbbells by applying the velocity-Verlet algorithm. More... | |
__device__ void | streamGaussianRodVelocityVerlet (const unsigned int particle1ID, MPCParticlePositionType *const positions, MPCParticleVelocityType *const velocities, const FP meanBondLength, const FP reducedSpringConstant, const FP timestep, const unsigned int stepCount) |
Streams the given Gaussian Rod by applying the velocity-Verlet algorithm. More... | |
__global__ void | streamGaussianRodsVelocityVerlet (const unsigned int workUnitOffset, MPCParticlePositionType *const positions, MPCParticleVelocityType *const velocities, const FP meanBondLength, const FP reducedSpringConstant, const FP timestep, const unsigned int stepCount) |
Streams the dumbbells by applying the velocity-Verlet algorithm. More... | |
__global__ void | streamHarmonicTrimerVelocityVerlet (const unsigned int workUnitOffset, MPCParticlePositionType *const positions, MPCParticleVelocityType *const velocities, const FP reducedSpringConstant1, const FP reducedSpringConstant2, const FP timestep, const unsigned int stepCount) |
Streams the given trimer via velocity-Verlet integration. More... | |
__global__ void | streamSimpleMPCParticle (const unsigned int workUnitOffset, MPCParticlePositionType *const positions, const MPCParticleVelocityType *const velocities) |
Streams the given simple, independent MPC particle. More... | |
void | getCenterOfMassVelocities_triplet (const unsigned int mpcParticleCount, const MPCParticleVelocityType *const velocities, MPCParticleVelocityType *const comVelocities) |
Saves the center-of-mass velocities of the MPC fluid's triplets to the given buffer. More... | |
__global__ void | getCenterOfMassVelocities_triplet_kernel (const unsigned int workUnitOffset, const MPCParticleVelocityType *const velocities, MPCParticleVelocityType *const comVelocities) |
Saves the center-of-mass velocities of the MPC fluid's triplets to the given buffer. More... | |
__device__ Vector3D< MPCParticleVelocityType > | getCenterOfMassVelocity_triplet (const unsigned int tripletID, const MPCParticleVelocityType *const velocities) |
Returns the center-of-mass velocity of for the given triplet. More... | |
const Vector3D< std::complex< MPCParticleVelocityType > > | calculateVelocityInFourierSpace_simpleMPCFluid (const unsigned int particleCount, const MPCParticlePositionType *const positions, const MPCParticleVelocityType *const velocities, const Vector3D< MPCParticlePositionType > k, MPCParticleVelocityType *const buffer1, MPCParticleVelocityType *const buffer2) |
Calculates the velocity in Fourier space, assuming a simple MPC fluid. More... | |
__global__ void | calculateVelocityInFourierSpace_simpleMPCFluid_single (const unsigned int workUnitOffset, const MPCParticlePositionType *const positions, const MPCParticleVelocityType *const velocities, const Vector3D< MPCParticlePositionType > k, MPCParticleVelocityType *const realBuffer, MPCParticleVelocityType *const imaginaryBuffer) |
Device function for calculation of summands of the real and imaginary part of the velocity in Fourier space, assuming a simple MPC fluid. More... | |
const Vector3D< std::complex< MPCParticleVelocityType > > | calculateVelocityInFourierSpace_doubletMPCFluid (const unsigned int doubletCount, const MPCParticlePositionType *const positions, const MPCParticleVelocityType *const velocities, const Vector3D< MPCParticlePositionType > k, MPCParticleVelocityType *const buffer1, MPCParticleVelocityType *const buffer2) |
Calculates the velocity in Fourier space, assuming an MPC fluid consisting of pairs of MPC particles. More... | |
__global__ void | calculateVelocityInFourierSpace_doubletMPCFluid_single (const unsigned int workUnitOffset, const MPCParticlePositionType *const positions, const MPCParticleVelocityType *const velocities, const Vector3D< MPCParticlePositionType > k, MPCParticleVelocityType *const realBuffer, MPCParticleVelocityType *const imaginaryBuffer) |
Device function for calculation of summands of the real and imaginary part of the velocity in Fourier space, assuming an MPC fluid consisting of pairs of MPC particles. More... | |
const Vector3D< std::complex< MPCParticleVelocityType > > | calculateVelocityInFourierSpace_tripletMPCFluid (const unsigned int tripletCount, const MPCParticlePositionType *const positions, const MPCParticleVelocityType *const velocities, const Vector3D< MPCParticlePositionType > k, MPCParticleVelocityType *const buffer1, MPCParticleVelocityType *const buffer2) |
Calculates the velocity in Fourier space, assuming an MPC fluid consisting of triplets of MPC particles. More... | |
__global__ void | calculateVelocityInFourierSpace_tripletMPCFluid_single (const unsigned int workUnitOffset, const MPCParticlePositionType *const positions, const MPCParticleVelocityType *const velocities, const Vector3D< MPCParticlePositionType > k, MPCParticleVelocityType *const realBuffer, MPCParticleVelocityType *const imaginaryBuffer) |
Device function for calculation of summands of the real and imaginary part of the velocity in Fourier space, assuming an MPC fluid consisting of triplets of MPC particles. More... | |
const Vector3D< std::complex< MPCParticleVelocityType > > | calculateVelocityInFourierSpace_chainMPCFluid (const unsigned int chainCount, const unsigned int chainLength, const MPCParticlePositionType *const positions, const MPCParticleVelocityType *const velocities, const Vector3D< MPCParticlePositionType > k, MPCParticleVelocityType *const buffer1, MPCParticleVelocityType *const buffer2) |
Calculates the velocity in Fourier space, assuming an MPC fluid consisting of chains of MPC particles. More... | |
__global__ void | calculateVelocityInFourierSpace_chainMPCFluid_single (const unsigned int workUnitOffset, const unsigned int chainLength, const MPCParticlePositionType *const positions, const MPCParticleVelocityType *const velocities, const Vector3D< MPCParticlePositionType > k, MPCParticleVelocityType *const realBuffer, MPCParticleVelocityType *const imaginaryBuffer) |
Device function for calculation of summands of the real and imaginary part of the velocity in Fourier space, assuming an MPC fluid consisting of chains of MPC particles. More... | |
const Vector3D< std::complex< MPCParticleVelocityType > > | reduceVelocityInFourierSpaceBuffers (const unsigned int summandCount, MPCParticleVelocityType *const realBuffer, MPCParticleVelocityType *const imaginaryBuffer) |
Reduces the calculated summands of the velocity in Fourier space. More... | |
Variables | |
__constant__ unsigned int | mpcParticleCount |
The number of MPC fluid particles. More... | |
__constant__ FP | omega |
__constant__ FP | cos_omegaTimesTimestep |
__constant__ FP | sin_omegaTimesTimestep |
const Vector3D<std::complex<MPCParticleVelocityType> > OpenMPCD::CUDA::MPCFluid::DeviceCode::calculateVelocityInFourierSpace_chainMPCFluid | ( | const unsigned int | chainCount, |
const unsigned int | chainLength, | ||
const MPCParticlePositionType *const | positions, | ||
const MPCParticleVelocityType *const | velocities, | ||
const Vector3D< MPCParticlePositionType > | k, | ||
MPCParticleVelocityType *const | buffer1, | ||
MPCParticleVelocityType *const | buffer2 | ||
) |
Calculates the velocity in Fourier space, assuming an MPC fluid consisting of chains of MPC particles.
[in] | chainCount | The number of MPC particle chains in the fluid. |
[in] | chainLength | The number of MPC fluid particles in a chain. |
[in] | positions | The array of MPC fluid particle positions. |
[in] | velocities | The array of MPC fluid particle velocities. |
[in] | k | The \(\vec{k}\) vector. |
[out] | buffer1 | A Device buffer that holds at least 3*chainCount*sizeof(MPCParticleVelocityType) bytes. |
[out] | buffer2 | A Device buffer that holds at least 3*chainCount*sizeof(MPCParticleVelocityType) bytes. |
__global__ void OpenMPCD::CUDA::MPCFluid::DeviceCode::calculateVelocityInFourierSpace_chainMPCFluid_single | ( | const unsigned int | workUnitOffset, |
const unsigned int | chainLength, | ||
const MPCParticlePositionType *const | positions, | ||
const MPCParticleVelocityType *const | velocities, | ||
const Vector3D< MPCParticlePositionType > | k, | ||
MPCParticleVelocityType *const | realBuffer, | ||
MPCParticleVelocityType *const | imaginaryBuffer | ||
) |
Device function for calculation of summands of the real and imaginary part of the velocity in Fourier space, assuming an MPC fluid consisting of chains of MPC particles.
[in] | workUnitOffset | The number of MPC particle chains to skip. |
[in] | chainLength | The number of MPC fluid particles in a chain. |
[in] | positions | The device array of MPC fluid particle positions. |
[in] | velocities | The device array of MPC fluid particle velocities. |
[in] | k | The \(\vec{k}\) vector. |
[out] | realBuffer | A Device buffer that holds at least 3*tripletCount*sizeof(MPCParticleVelocityType) bytes, used to store the real parts of the summands. |
[out] | imaginaryBuffer | A Device buffer that holds at least 3*tripletCount*sizeof(MPCParticleVelocityType) bytes, used to store the imaginary parts of the summands. |
const Vector3D<std::complex<MPCParticleVelocityType> > OpenMPCD::CUDA::MPCFluid::DeviceCode::calculateVelocityInFourierSpace_doubletMPCFluid | ( | const unsigned int | doubletCount, |
const MPCParticlePositionType *const | positions, | ||
const MPCParticleVelocityType *const | velocities, | ||
const Vector3D< MPCParticlePositionType > | k, | ||
MPCParticleVelocityType *const | buffer1, | ||
MPCParticleVelocityType *const | buffer2 | ||
) |
Calculates the velocity in Fourier space, assuming an MPC fluid consisting of pairs of MPC particles.
[in] | doubletCount | The number of MPC particle doublets in the fluid. |
[in] | positions | The array of MPC fluid particle positions. |
[in] | velocities | The array of MPC fluid particle velocities. |
[in] | k | The \(\vec{k}\) vector. |
[out] | buffer1 | A Device buffer that holds at least 3*doubletCount*sizeof(MPCParticleVelocityType) bytes. |
[out] | buffer2 | A Device buffer that holds at least 3*doubletCount*sizeof(MPCParticleVelocityType) bytes. |
__global__ void OpenMPCD::CUDA::MPCFluid::DeviceCode::calculateVelocityInFourierSpace_doubletMPCFluid_single | ( | const unsigned int | workUnitOffset, |
const MPCParticlePositionType *const | positions, | ||
const MPCParticleVelocityType *const | velocities, | ||
const Vector3D< MPCParticlePositionType > | k, | ||
MPCParticleVelocityType *const | realBuffer, | ||
MPCParticleVelocityType *const | imaginaryBuffer | ||
) |
Device function for calculation of summands of the real and imaginary part of the velocity in Fourier space, assuming an MPC fluid consisting of pairs of MPC particles.
[in] | workUnitOffset | The number of MPC particle doublets to skip. |
[in] | positions | The device array of MPC fluid particle positions. |
[in] | velocities | The device array of MPC fluid particle velocities. |
[in] | k | The \(\vec{k}\) vector. |
[out] | realBuffer | A Device buffer that holds at least 3*doubletCount*sizeof(MPCParticleVelocityType) bytes, used to store the real parts of the summands. |
[out] | imaginaryBuffer | A Device buffer that holds at least 3*doubletCount*sizeof(MPCParticleVelocityType) bytes, used to store the imaginary parts of the summands. |
const Vector3D<std::complex<MPCParticleVelocityType> > OpenMPCD::CUDA::MPCFluid::DeviceCode::calculateVelocityInFourierSpace_simpleMPCFluid | ( | const unsigned int | particleCount, |
const MPCParticlePositionType *const | positions, | ||
const MPCParticleVelocityType *const | velocities, | ||
const Vector3D< MPCParticlePositionType > | k, | ||
MPCParticleVelocityType *const | buffer1, | ||
MPCParticleVelocityType *const | buffer2 | ||
) |
Calculates the velocity in Fourier space, assuming a simple MPC fluid.
[in] | particleCount | The number of MPC particles in the fluid. |
[in] | positions | The array of MPC fluid particle positions. |
[in] | velocities | The array of MPC fluid particle velocities. |
[in] | k | The \(\vec{k}\) vector. |
[out] | buffer1 | A Device buffer that holds at least 3*numberOfConstituents*sizeof(MPCParticleVelocityType) bytes. |
[out] | buffer2 | A Device buffer that holds at least 3*numberOfConstituents*sizeof(MPCParticleVelocityType) bytes. |
__global__ void OpenMPCD::CUDA::MPCFluid::DeviceCode::calculateVelocityInFourierSpace_simpleMPCFluid_single | ( | const unsigned int | workUnitOffset, |
const MPCParticlePositionType *const | positions, | ||
const MPCParticleVelocityType *const | velocities, | ||
const Vector3D< MPCParticlePositionType > | k, | ||
MPCParticleVelocityType *const | realBuffer, | ||
MPCParticleVelocityType *const | imaginaryBuffer | ||
) |
Device function for calculation of summands of the real and imaginary part of the velocity in Fourier space, assuming a simple MPC fluid.
[in] | workUnitOffset | The number of particles to skip. |
[in] | positions | The device array of MPC fluid particle positions. |
[in] | velocities | The device array of MPC fluid particle velocities. |
[in] | k | The \(\vec{k}\) vector. |
[out] | realBuffer | A Device buffer that holds at least 3*numberOfConstituents*sizeof(MPCParticleVelocityType) bytes, used to store the real parts of the summands. |
[out] | imaginaryBuffer | A Device buffer that holds at least 3*numberOfConstituents*sizeof(MPCParticleVelocityType) bytes, used to store the imaginary parts of the summands. |
const Vector3D<std::complex<MPCParticleVelocityType> > OpenMPCD::CUDA::MPCFluid::DeviceCode::calculateVelocityInFourierSpace_tripletMPCFluid | ( | const unsigned int | tripletCount, |
const MPCParticlePositionType *const | positions, | ||
const MPCParticleVelocityType *const | velocities, | ||
const Vector3D< MPCParticlePositionType > | k, | ||
MPCParticleVelocityType *const | buffer1, | ||
MPCParticleVelocityType *const | buffer2 | ||
) |
Calculates the velocity in Fourier space, assuming an MPC fluid consisting of triplets of MPC particles.
[in] | tripletCount | The number of MPC particle triplets in the fluid. |
[in] | positions | The array of MPC fluid particle positions. |
[in] | velocities | The array of MPC fluid particle velocities. |
[in] | k | The \(\vec{k}\) vector. |
[out] | buffer1 | A Device buffer that holds at least 3*tripletCount*sizeof(MPCParticleVelocityType) bytes. |
[out] | buffer2 | A Device buffer that holds at least 3*tripletCount*sizeof(MPCParticleVelocityType) bytes. |
__global__ void OpenMPCD::CUDA::MPCFluid::DeviceCode::calculateVelocityInFourierSpace_tripletMPCFluid_single | ( | const unsigned int | workUnitOffset, |
const MPCParticlePositionType *const | positions, | ||
const MPCParticleVelocityType *const | velocities, | ||
const Vector3D< MPCParticlePositionType > | k, | ||
MPCParticleVelocityType *const | realBuffer, | ||
MPCParticleVelocityType *const | imaginaryBuffer | ||
) |
Device function for calculation of summands of the real and imaginary part of the velocity in Fourier space, assuming an MPC fluid consisting of triplets of MPC particles.
[in] | workUnitOffset | The number of MPC particle triplets to skip. |
[in] | positions | The device array of MPC fluid particle positions. |
[in] | velocities | The device array of MPC fluid particle velocities. |
[in] | k | The \(\vec{k}\) vector. |
[out] | realBuffer | A Device buffer that holds at least 3*tripletCount*sizeof(MPCParticleVelocityType) bytes, used to store the real parts of the summands. |
[out] | imaginaryBuffer | A Device buffer that holds at least 3*tripletCount*sizeof(MPCParticleVelocityType) bytes, used to store the imaginary parts of the summands. |
__global__ void OpenMPCD::CUDA::MPCFluid::DeviceCode::computeLogicalEntityCentersOfMass | ( | const unsigned int | workUnitOffset, |
const MPCParticlePositionType *const | positions, | ||
const unsigned int | numberOfLogicalEntities, | ||
const unsigned int | particlesPerLogicalEntity, | ||
MPCParticlePositionType *const | output | ||
) |
Computes the center of mass of logical entities, where each logical entity has a common number of constituent particles, each having the same mass.
Each thread of this kernel computes one center of mass.
[in] | workUnitOffset | The number of entities to skip; this is useful in case all entities cannot fit in one single kernel call. |
[in] | positions | The positions of the individual constituent particles, stored on the CUDA Device. It is assumed that first, the x coordinate of the first constituent particle of the first logical entity is stored, then its y and z coordinates; after that, the coordinates of the second constituent of the first logical entity, and so forth; after the last constituent of the first logical entity, the constituents of the second logical entity follow. In total, positions must hold at least 3 * particlesPerLogicalEntity * numberOfLogicalEntities elements. |
[in] | numberOfLogicalEntities | The number of logical entities to treat. |
[in] | particlesPerLogicalEntity | The number of MPC particles per logical entity, which must not be 0 . |
[out] | output | The CUDA Device buffer to save the coordinates to. It must be able to hold at least 3 * numberOfLogicalEntities elements. The first element in the buffer will be the x coordinate of the center of mass of the first logical entity, followed by the y and z coordinates. After that, the second entity's coordinates follow, and so on. |
const __device__ Vector3D<FP> OpenMPCD::CUDA::MPCFluid::DeviceCode::getAccelerationGaussianChainVelocityVerlet | ( | MPCParticlePositionType *const | positions, |
const unsigned int | firstParticleID, | ||
const unsigned int | particleID, | ||
const unsigned int | lastParticleID, | ||
const FP | reducedSpringConstant, | ||
const FP | timestep | ||
) |
Computes the acceleration experienced by the given particle in the Gaussian Chain.
No boundary conditions are considered.
[in] | positions | The array of MPC fluid particle positions. |
[in] | firstParticleID | The ID of the first particle in the chain. |
[in] | particleID | The ID of the particle to get the acceleration for. |
[in] | lastParticleID | The ID of the last particle in the chain. |
[in] | reducedSpringConstant | The spring constant, divided by the mass of an individual spring constituent particle. |
[in] | timestep | The timestep for an individual velocity-Verlet step. |
void OpenMPCD::CUDA::MPCFluid::DeviceCode::getCenterOfMassVelocities_chain | ( | const unsigned int | mpcParticleCount, |
const unsigned int | chainLength, | ||
const MPCParticleVelocityType *const | velocities, | ||
MPCParticleVelocityType *const | comVelocities | ||
) |
Saves the center-of-mass velocities of the MPC fluid's chains to the given buffer.
This function assumes that all chains have the same number of particles, and that all particles have the same mass.
This function requires that the OpenMPCD::CUDA::MPCFluid::DeviceCode::mpcParticleCount
symbol has been set, and its value is equal to the mpcParticleCount
passed to this function.
This function assumes that mpcParticleCount
is an integer multiple of chainLength
, and assumes both of them to be non-zero.
__global__ void OpenMPCD::CUDA::MPCFluid::DeviceCode::getCenterOfMassVelocities_chain_kernel | ( | const unsigned int | workUnitOffset, |
const unsigned int | chainLength, | ||
const MPCParticleVelocityType *const | velocities, | ||
MPCParticleVelocityType *const | comVelocities | ||
) |
Saves the center-of-mass velocities of the MPC fluid's chains to the given buffer.
This function assumes that all chains have the same number of particles, and that all particles have the same mass.
This function requires that the OpenMPCD::CUDA::MPCFluid::DeviceCode::mpcParticleCount
symbol has been set to a value that is non-zero and an integer multiple of chainLength
.
[in] | workUnitOffset | The number of chains to skip. |
[in] | chainLength | The number of individual MPC fluid particles per chain. |
[in] | velocities | The array of MPC fluid particle velocities. |
[out] | comVelocities | Buffer where the center-of-mass velocities are saved. |
void OpenMPCD::CUDA::MPCFluid::DeviceCode::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.
__global__ void OpenMPCD::CUDA::MPCFluid::DeviceCode::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.
[in] | workUnitOffset | The number of trimers to skip. |
[in] | velocities | The array of MPC fluid particle velocities. |
[out] | comVelocities | Buffer where the center-of-mass velocities are saved. |
void OpenMPCD::CUDA::MPCFluid::DeviceCode::getCenterOfMassVelocities_triplet | ( | const unsigned int | mpcParticleCount, |
const MPCParticleVelocityType *const | velocities, | ||
MPCParticleVelocityType *const | comVelocities | ||
) |
Saves the center-of-mass velocities of the MPC fluid's triplets to the given buffer.
__global__ void OpenMPCD::CUDA::MPCFluid::DeviceCode::getCenterOfMassVelocities_triplet_kernel | ( | const unsigned int | workUnitOffset, |
const MPCParticleVelocityType *const | velocities, | ||
MPCParticleVelocityType *const | comVelocities | ||
) |
Saves the center-of-mass velocities of the MPC fluid's triplets to the given buffer.
[in] | workUnitOffset | The number of trimers to skip. |
[in] | velocities | The array of MPC fluid particle velocities. |
[out] | comVelocities | Buffer where the center-of-mass velocities are saved. |
__device__ Vector3D<MPCParticleVelocityType> OpenMPCD::CUDA::MPCFluid::DeviceCode::getCenterOfMassVelocity_chain | ( | const unsigned int | chainID, |
const unsigned int | chainLength, | ||
const MPCParticleVelocityType *const | velocities | ||
) |
Returns the center-of-mass velocity of for the given chain.
This function assumes that all chains have the same number of particles, and that all particles have the same mass.
[in] | chainID | The ID of the chain. |
[in] | chainLength | The number of individual MPC fluid particles per chain. |
[in] | velocities | The array of MPC fluid particle velocities. |
__device__ Vector3D<MPCParticleVelocityType> OpenMPCD::CUDA::MPCFluid::DeviceCode::getCenterOfMassVelocity_doublet | ( | const unsigned int | doubletID, |
const MPCParticleVelocityType *const | velocities | ||
) |
Returns the center-of-mass velocity of for the given doublet.
This function assumes that both constituents have the same mass.
[in] | doubletID | The ID of the doublet. |
[in] | velocities | The array of MPC fluid particle velocities. |
__device__ Vector3D<MPCParticleVelocityType> OpenMPCD::CUDA::MPCFluid::DeviceCode::getCenterOfMassVelocity_triplet | ( | const unsigned int | tripletID, |
const MPCParticleVelocityType *const | velocities | ||
) |
Returns the center-of-mass velocity of for the given triplet.
This function assumes that all three constituents have the same mass.
[in] | tripletID | The ID of the triplet. |
[in] | velocities | The array of MPC fluid particle velocities. |
const Vector3D<std::complex<MPCParticleVelocityType> > OpenMPCD::CUDA::MPCFluid::DeviceCode::reduceVelocityInFourierSpaceBuffers | ( | const unsigned int | summandCount, |
MPCParticleVelocityType *const | realBuffer, | ||
MPCParticleVelocityType *const | imaginaryBuffer | ||
) |
Reduces the calculated summands of the velocity in Fourier space.
[in] | summandCount | The number of summands. |
[in] | realBuffer | Device buffer holding the real parts of the summands. |
[in] | imaginaryBuffer | Device buffer holding the imaginary parts of the summands. |
void OpenMPCD::CUDA::MPCFluid::DeviceCode::setGaussianDumbbellSymbols | ( | const FP | omega_, |
const FP | timestep | ||
) |
Sets the constant symbols.
[in] | omega_ | The omega factor. (see http://dx.doi.org/10.1063/1.4792196) |
[in] | timestep | The timestep for the MPC fluid streaming step. |
void OpenMPCD::CUDA::MPCFluid::DeviceCode::setMPCParticleCountSymbol | ( | const unsigned int | count | ) |
Sets the symbol mpcParticleCount.
[in] | count | The number of MPC fluid particles. |
__device__ void OpenMPCD::CUDA::MPCFluid::DeviceCode::streamDumbbellAnalytically | ( | const unsigned int | particle1ID, |
MPCParticlePositionType *const | positions, | ||
MPCParticleVelocityType *const | velocities | ||
) |
Streams the given dumbbell by applying the analytical solution of the equations of motion.
No boundary conditions are considered.
[in] | particle1ID | The ID of the first particle; the partner is the one with this ID incremented by 1. |
[in,out] | positions | The array of MPC fluid particle positions. |
[in,out] | velocities | The array of MPC fluid particle velocities. |
__global__ void OpenMPCD::CUDA::MPCFluid::DeviceCode::streamDumbbellsAnalytically | ( | const unsigned int | workUnitOffset, |
MPCParticlePositionType *const | positions, | ||
MPCParticleVelocityType *const | velocities | ||
) |
Streams the dumbbells by applying the analytical solution of the equations of motion.
No boundary conditions are considered.
[in] | workUnitOffset | The number of dumbbells to skip. |
[in,out] | positions | The array of MPC fluid particle positions. |
[in,out] | velocities | The array of MPC fluid particle velocities. |
__global__ void OpenMPCD::CUDA::MPCFluid::DeviceCode::streamDumbbellsVelocityVerlet | ( | const unsigned int | workUnitOffset, |
MPCParticlePositionType *const | positions, | ||
MPCParticleVelocityType *const | velocities, | ||
const FP | reducedSpringConstant, | ||
const FP | timestep, | ||
const unsigned int | stepCount | ||
) |
Streams the dumbbells by applying the velocity-Verlet algorithm.
No boundary conditions are considered.
[in] | workUnitOffset | The number of dumbbells to skip. |
[in,out] | positions | The array of MPC fluid particle positions. |
[in,out] | velocities | The array of MPC fluid particle velocities. |
[in] | reducedSpringConstant | The spring constant connecting the two dumbbell contituents, divided by the mass of each one constituent. |
[in] | timestep | The timestep for an individual velocity-Verlet step. |
[in] | stepCount | The number of velocity-Verlet steps to perform. |
__device__ void OpenMPCD::CUDA::MPCFluid::DeviceCode::streamDumbbellVelocityVerlet | ( | const unsigned int | particle1ID, |
MPCParticlePositionType *const | positions, | ||
MPCParticleVelocityType *const | velocities, | ||
const FP | reducedSpringConstant, | ||
const FP | timestep, | ||
const unsigned int | stepCount | ||
) |
Streams the given dumbbell by applying the velocity-Verlet algorithm.
No boundary conditions are considered.
[in] | particle1ID | The ID of the first particle; the partner is the one with this ID incremented by 1. |
[in,out] | positions | The array of MPC fluid particle positions. |
[in,out] | velocities | The array of MPC fluid particle velocities. |
[in] | reducedSpringConstant | The spring constant connecting the two dumbbell contituents, divided by the mass of each one constituent. |
[in] | timestep | The timestep for an individual velocity-Verlet step. |
[in] | stepCount | The number of velocity-Verlet steps to perform. |
__global__ void OpenMPCD::CUDA::MPCFluid::DeviceCode::streamGaussianChainsVelocityVerlet | ( | const unsigned int | workUnitOffset, |
MPCParticlePositionType *const | positions, | ||
MPCParticleVelocityType *const | velocities, | ||
FP *const | accelerationBuffer, | ||
const unsigned int | particlesPerChain, | ||
const FP | reducedSpringConstant, | ||
const FP | timestep, | ||
const unsigned int | stepCount | ||
) |
Streams the dumbbells by applying the velocity-Verlet algorithm.
No boundary conditions are considered.
[in] | workUnitOffset | The number of chains to skip. |
[in,out] | positions | The array of MPC fluid particle positions. |
[in,out] | velocities | The array of MPC fluid particle velocities. |
[in,out] | accelerationBuffer | Buffer used to store initial accelerations during the Velocity Verlet integration. This has to have at least as many elements as there are MPC fluid particles. |
[in] | particlesPerChain | The number of particles per chain. |
[in] | reducedSpringConstant | The spring constant, divided by the mass of an individual spring constituent particle. |
[in] | timestep | The timestep for an individual velocity-Verlet step. |
[in] | stepCount | The number of velocity-Verlet steps to perform. |
__device__ void OpenMPCD::CUDA::MPCFluid::DeviceCode::streamGaussianChainVelocityVerlet | ( | const unsigned int | particle1ID, |
MPCParticlePositionType *const | positions, | ||
MPCParticleVelocityType *const | velocities, | ||
FP *const | accelerationBuffer, | ||
const unsigned int | particlesPerChain, | ||
const FP | reducedSpringConstant, | ||
const FP | timestep, | ||
const unsigned int | stepCount | ||
) |
Streams the given Gaussian Chain by applying the velocity-Verlet algorithm.
No boundary conditions are considered.
[in] | particle1ID | The ID of the first particle; the partner are obtained by successive incrementing. |
[in,out] | positions | The array of MPC fluid particle positions. |
[in,out] | velocities | The array of MPC fluid particle velocities. |
[in,out] | accelerationBuffer | Buffer used to store initial accelerations during the Velocity Verlet integration. This has to have at least as many elements as there are MPC fluid particles. |
[in] | particlesPerChain | The number of particles per chain. |
[in] | reducedSpringConstant | The spring constant, divided by the mass of an individual spring constituent particle. |
[in] | timestep | The timestep for an individual velocity-Verlet step. |
[in] | stepCount | The number of velocity-Verlet steps to perform. |
__global__ void OpenMPCD::CUDA::MPCFluid::DeviceCode::streamGaussianRodsVelocityVerlet | ( | const unsigned int | workUnitOffset, |
MPCParticlePositionType *const | positions, | ||
MPCParticleVelocityType *const | velocities, | ||
const FP | meanBondLength, | ||
const FP | reducedSpringConstant, | ||
const FP | timestep, | ||
const unsigned int | stepCount | ||
) |
Streams the dumbbells by applying the velocity-Verlet algorithm.
No boundary conditions are considered.
[in] | workUnitOffset | The number of dumbbells to skip. |
[in,out] | positions | The array of MPC fluid particle positions. |
[in,out] | velocities | The array of MPC fluid particle velocities. |
[in] | meanBondLength | The mean bond length. |
[in] | reducedSpringConstant | The spring constant, divided by the mass of an individual spring constituent particle. |
[in] | timestep | The timestep for an individual velocity-Verlet step. |
[in] | stepCount | The number of velocity-Verlet steps to perform. |
__device__ void OpenMPCD::CUDA::MPCFluid::DeviceCode::streamGaussianRodVelocityVerlet | ( | const unsigned int | particle1ID, |
MPCParticlePositionType *const | positions, | ||
MPCParticleVelocityType *const | velocities, | ||
const FP | meanBondLength, | ||
const FP | reducedSpringConstant, | ||
const FP | timestep, | ||
const unsigned int | stepCount | ||
) |
Streams the given Gaussian Rod by applying the velocity-Verlet algorithm.
No boundary conditions are considered.
[in] | particle1ID | The ID of the first particle; the partner is the one with this ID incremented by 1. |
[in,out] | positions | The array of MPC fluid particle positions. |
[in,out] | velocities | The array of MPC fluid particle velocities. |
[in] | meanBondLength | The mean bond length. |
[in] | reducedSpringConstant | The spring constant, divided by the mass of an individual spring constituent particle. |
[in] | timestep | The timestep for an individual velocity-Verlet step. |
[in] | stepCount | The number of velocity-Verlet steps to perform. |
__global__ void OpenMPCD::CUDA::MPCFluid::DeviceCode::streamHarmonicTrimerVelocityVerlet | ( | const unsigned int | workUnitOffset, |
MPCParticlePositionType *const | positions, | ||
MPCParticleVelocityType *const | velocities, | ||
const FP | reducedSpringConstant1, | ||
const FP | reducedSpringConstant2, | ||
const FP | timestep, | ||
const unsigned int | stepCount | ||
) |
Streams the given trimer via velocity-Verlet integration.
No boundary conditions are considered. This function assumes that the individual particles in the trimer all have mass 1.
[in] | workUnitOffset | The number of trimers to skip. |
[in,out] | positions | The array of MPC fluid particle positions. |
[in,out] | velocities | The array of MPC fluid particle velocities. |
[in] | reducedSpringConstant1 | The spring constant for the spring between particles 1 and 2, divided by the mass of an individual constituent particle. |
[in] | reducedSpringConstant2 | The spring constant for the spring between particles 2 and 3, divided by the mass of an individual constituent particle. |
[in] | timestep | The timestep for an individual velocity-Verlet step. |
[in] | stepCount | The number of velocity-Verlet steps to perform. |
__global__ void OpenMPCD::CUDA::MPCFluid::DeviceCode::streamSimpleMPCParticle | ( | const unsigned int | workUnitOffset, |
MPCParticlePositionType *const | positions, | ||
const MPCParticleVelocityType *const | velocities | ||
) |
Streams the given simple, independent MPC particle.
No boundary conditions are considered.
[in] | workUnitOffset | The number of MPC fluid particles to skip. |
[in,out] | positions | The array of MPC fluid particle positions. |
[in,out] | velocities | The array of MPC fluid particle velocities. |
__constant__ unsigned int OpenMPCD::CUDA::MPCFluid::DeviceCode::mpcParticleCount |
The number of MPC fluid particles.