OpenMPCD
Functions | Variables
OpenMPCD::CUDA::MPCFluid::DeviceCode Namespace Reference

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< MPCParticleVelocityTypegetCenterOfMassVelocity_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< MPCParticleVelocityTypegetCenterOfMassVelocity_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< FPgetAccelerationGaussianChainVelocityVerlet (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< MPCParticleVelocityTypegetCenterOfMassVelocity_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
 

Detailed Description

Contains CUDA Device code.

Function Documentation

◆ calculateVelocityInFourierSpace_chainMPCFluid()

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.

See Velocity in Fourier Space

Parameters
[in]chainCountThe number of MPC particle chains in the fluid.
[in]chainLengthThe number of MPC fluid particles in a chain.
[in]positionsThe array of MPC fluid particle positions.
[in]velocitiesThe array of MPC fluid particle velocities.
[in]kThe \(\vec{k}\) vector.
[out]buffer1A Device buffer that holds at least 3*chainCount*sizeof(MPCParticleVelocityType) bytes.
[out]buffer2A Device buffer that holds at least 3*chainCount*sizeof(MPCParticleVelocityType) bytes.

◆ calculateVelocityInFourierSpace_chainMPCFluid_single()

__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.

Remarks
This function is not intended to be called directly by the user. Instead, call calculateVelocityInFourierSpace_chainMPCFluid().

See Velocity in Fourier Space

Parameters
[in]workUnitOffsetThe number of MPC particle chains to skip.
[in]chainLengthThe number of MPC fluid particles in a chain.
[in]positionsThe device array of MPC fluid particle positions.
[in]velocitiesThe device array of MPC fluid particle velocities.
[in]kThe \(\vec{k}\) vector.
[out]realBufferA Device buffer that holds at least 3*tripletCount*sizeof(MPCParticleVelocityType) bytes, used to store the real parts of the summands.
[out]imaginaryBufferA Device buffer that holds at least 3*tripletCount*sizeof(MPCParticleVelocityType) bytes, used to store the imaginary parts of the summands.

◆ calculateVelocityInFourierSpace_doubletMPCFluid()

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.

See Velocity in Fourier Space

Parameters
[in]doubletCountThe number of MPC particle doublets in the fluid.
[in]positionsThe array of MPC fluid particle positions.
[in]velocitiesThe array of MPC fluid particle velocities.
[in]kThe \(\vec{k}\) vector.
[out]buffer1A Device buffer that holds at least 3*doubletCount*sizeof(MPCParticleVelocityType) bytes.
[out]buffer2A Device buffer that holds at least 3*doubletCount*sizeof(MPCParticleVelocityType) bytes.

◆ calculateVelocityInFourierSpace_doubletMPCFluid_single()

__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.

Remarks
This function is not intended to be called directly by the user. Instead, call calculateVelocityInFourierSpace_doubletMPCFluid().

See Velocity in Fourier Space

Parameters
[in]workUnitOffsetThe number of MPC particle doublets to skip.
[in]positionsThe device array of MPC fluid particle positions.
[in]velocitiesThe device array of MPC fluid particle velocities.
[in]kThe \(\vec{k}\) vector.
[out]realBufferA Device buffer that holds at least 3*doubletCount*sizeof(MPCParticleVelocityType) bytes, used to store the real parts of the summands.
[out]imaginaryBufferA Device buffer that holds at least 3*doubletCount*sizeof(MPCParticleVelocityType) bytes, used to store the imaginary parts of the summands.

◆ calculateVelocityInFourierSpace_simpleMPCFluid()

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.

See Velocity in Fourier Space

Parameters
[in]particleCountThe number of MPC particles in the fluid.
[in]positionsThe array of MPC fluid particle positions.
[in]velocitiesThe array of MPC fluid particle velocities.
[in]kThe \(\vec{k}\) vector.
[out]buffer1A Device buffer that holds at least 3*numberOfConstituents*sizeof(MPCParticleVelocityType) bytes.
[out]buffer2A Device buffer that holds at least 3*numberOfConstituents*sizeof(MPCParticleVelocityType) bytes.

◆ calculateVelocityInFourierSpace_simpleMPCFluid_single()

__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.

Remarks
This function is not intended to be called directly by the user. Instead, call calculateVelocityInFourierSpace_simpleMPCFluid().

See Velocity in Fourier Space

Parameters
[in]workUnitOffsetThe number of particles to skip.
[in]positionsThe device array of MPC fluid particle positions.
[in]velocitiesThe device array of MPC fluid particle velocities.
[in]kThe \(\vec{k}\) vector.
[out]realBufferA Device buffer that holds at least 3*numberOfConstituents*sizeof(MPCParticleVelocityType) bytes, used to store the real parts of the summands.
[out]imaginaryBufferA Device buffer that holds at least 3*numberOfConstituents*sizeof(MPCParticleVelocityType) bytes, used to store the imaginary parts of the summands.

◆ calculateVelocityInFourierSpace_tripletMPCFluid()

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.

See Velocity in Fourier Space

Parameters
[in]tripletCountThe number of MPC particle triplets in the fluid.
[in]positionsThe array of MPC fluid particle positions.
[in]velocitiesThe array of MPC fluid particle velocities.
[in]kThe \(\vec{k}\) vector.
[out]buffer1A Device buffer that holds at least 3*tripletCount*sizeof(MPCParticleVelocityType) bytes.
[out]buffer2A Device buffer that holds at least 3*tripletCount*sizeof(MPCParticleVelocityType) bytes.

◆ calculateVelocityInFourierSpace_tripletMPCFluid_single()

__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.

Remarks
This function is not intended to be called directly by the user. Instead, call calculateVelocityInFourierSpace_tripletMPCFluid().

See Velocity in Fourier Space

Parameters
[in]workUnitOffsetThe number of MPC particle triplets to skip.
[in]positionsThe device array of MPC fluid particle positions.
[in]velocitiesThe device array of MPC fluid particle velocities.
[in]kThe \(\vec{k}\) vector.
[out]realBufferA Device buffer that holds at least 3*tripletCount*sizeof(MPCParticleVelocityType) bytes, used to store the real parts of the summands.
[out]imaginaryBufferA Device buffer that holds at least 3*tripletCount*sizeof(MPCParticleVelocityType) bytes, used to store the imaginary parts of the summands.

◆ computeLogicalEntityCentersOfMass()

__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.

Parameters
[in]workUnitOffsetThe number of entities to skip; this is useful in case all entities cannot fit in one single kernel call.
[in]positionsThe 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]numberOfLogicalEntitiesThe number of logical entities to treat.
[in]particlesPerLogicalEntityThe number of MPC particles per logical entity, which must not be 0.
[out]outputThe 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.

◆ getAccelerationGaussianChainVelocityVerlet()

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.

Parameters
[in]positionsThe array of MPC fluid particle positions.
[in]firstParticleIDThe ID of the first particle in the chain.
[in]particleIDThe ID of the particle to get the acceleration for.
[in]lastParticleIDThe ID of the last particle in the chain.
[in]reducedSpringConstantThe spring constant, divided by the mass of an individual spring constituent particle.
[in]timestepThe timestep for an individual velocity-Verlet step.

◆ getCenterOfMassVelocities_chain()

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.

Parameters
[in]mpcParticleCountThe number of individual MPC fluid particles.
[in]chainLengthThe number of individual MPC fluid particles per chain.
[in]velocitiesThe Device array of MPC fluid particle velocities.
[out]comVelocitiesDevice buffer where the center-of-mass velocities are saved.

◆ getCenterOfMassVelocities_chain_kernel()

__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.

Parameters
[in]workUnitOffsetThe number of chains to skip.
[in]chainLengthThe number of individual MPC fluid particles per chain.
[in]velocitiesThe array of MPC fluid particle velocities.
[out]comVelocitiesBuffer where the center-of-mass velocities are saved.

◆ getCenterOfMassVelocities_doublet()

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.

Parameters
[in]mpcParticleCountThe number of individual MPC fluid particles.
[in]velocitiesThe Device array of MPC fluid particle velocities.
[out]comVelocitiesDevice buffer where the center-of-mass velocities are saved.

◆ getCenterOfMassVelocities_doublet_kernel()

__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.

Parameters
[in]workUnitOffsetThe number of trimers to skip.
[in]velocitiesThe array of MPC fluid particle velocities.
[out]comVelocitiesBuffer where the center-of-mass velocities are saved.

◆ getCenterOfMassVelocities_triplet()

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.

Parameters
[in]mpcParticleCountThe number of individual MPC fluid particles.
[in]velocitiesThe Device array of MPC fluid particle velocities.
[out]comVelocitiesDevice buffer where the center-of-mass velocities are saved.

◆ getCenterOfMassVelocities_triplet_kernel()

__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.

Parameters
[in]workUnitOffsetThe number of trimers to skip.
[in]velocitiesThe array of MPC fluid particle velocities.
[out]comVelocitiesBuffer where the center-of-mass velocities are saved.

◆ getCenterOfMassVelocity_chain()

__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.

Parameters
[in]chainIDThe ID of the chain.
[in]chainLengthThe number of individual MPC fluid particles per chain.
[in]velocitiesThe array of MPC fluid particle velocities.

◆ getCenterOfMassVelocity_doublet()

__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.

Parameters
[in]doubletIDThe ID of the doublet.
[in]velocitiesThe array of MPC fluid particle velocities.

◆ getCenterOfMassVelocity_triplet()

__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.

Parameters
[in]tripletIDThe ID of the triplet.
[in]velocitiesThe array of MPC fluid particle velocities.

◆ reduceVelocityInFourierSpaceBuffers()

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.

Remarks
This function is not intended to be called by the user.

See Velocity in Fourier Space

Parameters
[in]summandCountThe number of summands.
[in]realBufferDevice buffer holding the real parts of the summands.
[in]imaginaryBufferDevice buffer holding the imaginary parts of the summands.
Returns
Returns the velocity in Fourier space.

◆ setGaussianDumbbellSymbols()

void OpenMPCD::CUDA::MPCFluid::DeviceCode::setGaussianDumbbellSymbols ( const FP  omega_,
const FP  timestep 
)

Sets the constant symbols.

Parameters
[in]omega_The omega factor. (see http://dx.doi.org/10.1063/1.4792196)
[in]timestepThe timestep for the MPC fluid streaming step.

◆ setMPCParticleCountSymbol()

void OpenMPCD::CUDA::MPCFluid::DeviceCode::setMPCParticleCountSymbol ( const unsigned int  count)

Sets the symbol mpcParticleCount.

Parameters
[in]countThe number of MPC fluid particles.

◆ streamDumbbellAnalytically()

__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.

Parameters
[in]particle1IDThe ID of the first particle; the partner is the one with this ID incremented by 1.
[in,out]positionsThe array of MPC fluid particle positions.
[in,out]velocitiesThe array of MPC fluid particle velocities.

◆ streamDumbbellsAnalytically()

__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.

Parameters
[in]workUnitOffsetThe number of dumbbells to skip.
[in,out]positionsThe array of MPC fluid particle positions.
[in,out]velocitiesThe array of MPC fluid particle velocities.

◆ streamDumbbellsVelocityVerlet()

__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.

Parameters
[in]workUnitOffsetThe number of dumbbells to skip.
[in,out]positionsThe array of MPC fluid particle positions.
[in,out]velocitiesThe array of MPC fluid particle velocities.
[in]reducedSpringConstantThe spring constant connecting the two dumbbell contituents, divided by the mass of each one constituent.
[in]timestepThe timestep for an individual velocity-Verlet step.
[in]stepCountThe number of velocity-Verlet steps to perform.

◆ streamDumbbellVelocityVerlet()

__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.

Parameters
[in]particle1IDThe ID of the first particle; the partner is the one with this ID incremented by 1.
[in,out]positionsThe array of MPC fluid particle positions.
[in,out]velocitiesThe array of MPC fluid particle velocities.
[in]reducedSpringConstantThe spring constant connecting the two dumbbell contituents, divided by the mass of each one constituent.
[in]timestepThe timestep for an individual velocity-Verlet step.
[in]stepCountThe number of velocity-Verlet steps to perform.

◆ streamGaussianChainsVelocityVerlet()

__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.

Parameters
[in]workUnitOffsetThe number of chains to skip.
[in,out]positionsThe array of MPC fluid particle positions.
[in,out]velocitiesThe array of MPC fluid particle velocities.
[in,out]accelerationBufferBuffer 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]particlesPerChainThe number of particles per chain.
[in]reducedSpringConstantThe spring constant, divided by the mass of an individual spring constituent particle.
[in]timestepThe timestep for an individual velocity-Verlet step.
[in]stepCountThe number of velocity-Verlet steps to perform.

◆ streamGaussianChainVelocityVerlet()

__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.

Parameters
[in]particle1IDThe ID of the first particle; the partner are obtained by successive incrementing.
[in,out]positionsThe array of MPC fluid particle positions.
[in,out]velocitiesThe array of MPC fluid particle velocities.
[in,out]accelerationBufferBuffer 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]particlesPerChainThe number of particles per chain.
[in]reducedSpringConstantThe spring constant, divided by the mass of an individual spring constituent particle.
[in]timestepThe timestep for an individual velocity-Verlet step.
[in]stepCountThe number of velocity-Verlet steps to perform.

◆ streamGaussianRodsVelocityVerlet()

__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.

Parameters
[in]workUnitOffsetThe number of dumbbells to skip.
[in,out]positionsThe array of MPC fluid particle positions.
[in,out]velocitiesThe array of MPC fluid particle velocities.
[in]meanBondLengthThe mean bond length.
[in]reducedSpringConstantThe spring constant, divided by the mass of an individual spring constituent particle.
[in]timestepThe timestep for an individual velocity-Verlet step.
[in]stepCountThe number of velocity-Verlet steps to perform.

◆ streamGaussianRodVelocityVerlet()

__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.

Parameters
[in]particle1IDThe ID of the first particle; the partner is the one with this ID incremented by 1.
[in,out]positionsThe array of MPC fluid particle positions.
[in,out]velocitiesThe array of MPC fluid particle velocities.
[in]meanBondLengthThe mean bond length.
[in]reducedSpringConstantThe spring constant, divided by the mass of an individual spring constituent particle.
[in]timestepThe timestep for an individual velocity-Verlet step.
[in]stepCountThe number of velocity-Verlet steps to perform.

◆ streamHarmonicTrimerVelocityVerlet()

__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.

Parameters
[in]workUnitOffsetThe number of trimers to skip.
[in,out]positionsThe array of MPC fluid particle positions.
[in,out]velocitiesThe array of MPC fluid particle velocities.
[in]reducedSpringConstant1The spring constant for the spring between particles 1 and 2, divided by the mass of an individual constituent particle.
[in]reducedSpringConstant2The spring constant for the spring between particles 2 and 3, divided by the mass of an individual constituent particle.
[in]timestepThe timestep for an individual velocity-Verlet step.
[in]stepCountThe number of velocity-Verlet steps to perform.

◆ streamSimpleMPCParticle()

__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.

Parameters
[in]workUnitOffsetThe number of MPC fluid particles to skip.
[in,out]positionsThe array of MPC fluid particle positions.
[in,out]velocitiesThe array of MPC fluid particle velocities.

Variable Documentation

◆ mpcParticleCount

__constant__ unsigned int OpenMPCD::CUDA::MPCFluid::DeviceCode::mpcParticleCount

The number of MPC fluid particles.