OpenMPCD
Functions
OpenMPCD::CUDA::NormalMode Namespace Reference

Namespace for Host-callable CUDA functionality related to normal modes. More...

Functions

void computeNormalCoordinates (const unsigned int chainLength, const unsigned int chainCount, const MPCParticlePositionType *const positions, MPCParticlePositionType *const normalModeCoordinates, const MPCParticlePositionType shift=0)
 Calculates all normal coordinates for a number of polymer chains stored contiguously in Device memory. More...
 
const std::vector< MPCParticlePositionTypegetAverageNormalCoordinateAutocorrelation (const unsigned int chainLength, const unsigned int chainCount, const MPCParticlePositionType *const normalModes0, const MPCParticlePositionType *const normalModesT)
 Computes the average normal mode coordinate autocorrelation functions. More...
 

Detailed Description

Namespace for Host-callable CUDA functionality related to normal modes.

See also
OpenMPCD::NormalMode

Function Documentation

◆ computeNormalCoordinates()

void OpenMPCD::CUDA::NormalMode::computeNormalCoordinates ( const unsigned int  chainLength,
const unsigned int  chainCount,
const MPCParticlePositionType *const  positions,
MPCParticlePositionType *const  normalModeCoordinates,
const MPCParticlePositionType  shift = 0 
)

Calculates all normal coordinates for a number of polymer chains stored contiguously in Device memory.

See also
OpenMPCD::NormalMode
Exceptions
OpenMPCD::InvalidArgumentExceptionIf OPENMPCD_DEBUG is defined, throws if chainLength == 0.
OpenMPCD::NULLPointerExceptionIf OPENMPCD_DEBUG is defined, throws if normalModes0 == nullptr.
OpenMPCD::NULLPointerExceptionIf OPENMPCD_DEBUG is defined, throws if normalModesT == nullptr.
Parameters
[in]chainLengthThe number of particles in a chain, which must be greater than 0.
[in]chainCountThe number of chains present.
[in]positionsThe Device array of particle positions. It is assumed that first, the x, y, and z coordinates of the first chain's first particle are stored, followed by the first chain's second particle, and so forth, up to the first chain's last particle. After that, the second chain's particles follow in a similar fashion, and so forth.
[out]normalModeCoordinatesA Device buffer that holds at least 3 * chainCount * (chainLength + 1) elements, where the calculated normal mode coordinates will be saved. First, the normal mode coordinates of the first chain will be saved (starting with the x, y, and z coordinate of the normal mode 0, followed by mode 1, up to and including mode N), followed by the second chain, and so forth.
[in]shiftThe shift parameter \( S \).

◆ getAverageNormalCoordinateAutocorrelation()

const std::vector<MPCParticlePositionType> OpenMPCD::CUDA::NormalMode::getAverageNormalCoordinateAutocorrelation ( const unsigned int  chainLength,
const unsigned int  chainCount,
const MPCParticlePositionType *const  normalModes0,
const MPCParticlePositionType *const  normalModesT 
)

Computes the average normal mode coordinate autocorrelation functions.

With \( \vec{q}_i^k (t) \) being the normal mode coordinates for mode \( i \) of chain \( k \) at time \( t \), this returns, for each normal mode \( i \in \left[0, N\right] \) and with \( N_C \) being the number of chains in the fluid, the average \( N_C^{-1} \sum_{k=1}^{N_C} \vec{q}_i^k (0) \cdot \vec{q}_i^k (T) \), where \( \cdot \) denotes the inner product.

See also
OpenMPCD::NormalMode
Exceptions
OpenMPCD::InvalidArgumentExceptionThrows if chainLength == 0.
OpenMPCD::NULLPointerExceptionIf OPENMPCD_DEBUG is defined, throws if normalModes0 == nullptr.
OpenMPCD::NULLPointerExceptionIf OPENMPCD_DEBUG is defined, throws if normalModesT == nullptr.
Parameters
[in]chainLengthThe number of particles in a chain, which must not be 0.
[in]chainCountThe number \( N_C \) of chains.
[in]normalModes0Device pointer to the normal mode coordinates at time \( 0 \), as calculated by calculateNormalModeCoordinatesForChain.
[in]normalModesTDevice pointer to the normal mode coordinates at time \( T \), as calculated by calculateNormalModeCoordinatesForChain.
Returns
Returns the average autocorrelation of the normal mode vector \( \vec{q}_i \) at index i, for all i in the range [0, chainLength].