OpenMPCD
Functions
OpenMPCD::CUDA::DeviceCode::NormalMode Namespace Reference

Namespace for CUDA Device functionality related to normal modes. More...

Functions

template<typename T >
const OPENMPCD_CUDA_DEVICE Vector3D< T > computeNormalCoordinate (const unsigned int i, const Vector3D< T > *const vectors, const std::size_t N, const T shift=0)
 Calculates a normal coordinate. More...
 
template<typename T >
const OPENMPCD_CUDA_DEVICE Vector3D< T > computeNormalCoordinate (const unsigned int i, const T *const vectors, const std::size_t N, const T shift=0)
 Calculates a normal coordinate. More...
 
template<typename T >
OPENMPCD_CUDA_DEVICE void computeNormalCoordinates (const T *const vectors, const std::size_t N, T *const result, const T shift=0)
 Calculates all normal coordinates for the given array of vectors. More...
 
template<typename T >
__global__ void computeNormalCoordinates (const unsigned int workUnitOffset, const unsigned int chainLength, const unsigned int chainCount, const T *const positions, T *const normalModeCoordinates, const T shift=0)
 Calculates all normal coordinates for a number of polymer chains stored contiguously in memory. More...
 

Detailed Description

Namespace for CUDA Device functionality related to normal modes.

See also
OpenMPCD::NormalMode

Function Documentation

◆ computeNormalCoordinate() [1/2]

template<typename T >
const OPENMPCD_CUDA_DEVICE Vector3D< T > OpenMPCD::CUDA::DeviceCode::NormalMode::computeNormalCoordinate ( const unsigned int  i,
const T *const  vectors,
const std::size_t  N,
const T  shift = 0 
)

Calculates a normal coordinate.

See also
OpenMPCD::NormalMode
Template Parameters
TThe underlying floating-point data type.
Parameters
[in]iThe index of the normal coordinate to compute, which must lie in the range [0, N].
[in]vectorsThe input vectors to use. Must be a non-nullptr Device pointer pointing to at least 3 * N instances, which will be interpreted as N three-dimensional vectors, with the first three instances belonging to the first vector, and so forth.
[in]NThe number of input coordinate vectors, which must not be 0.
[in]shiftThe shift parameter \( S \).

Definition at line 53 of file CUDA/DeviceCode/ImplementationDetails/NormalMode.hpp.

◆ computeNormalCoordinate() [2/2]

template<typename T >
const OPENMPCD_CUDA_DEVICE Vector3D< T > OpenMPCD::CUDA::DeviceCode::NormalMode::computeNormalCoordinate ( const unsigned int  i,
const Vector3D< T > *const  vectors,
const std::size_t  N,
const T  shift = 0 
)

Calculates a normal coordinate.

See also
OpenMPCD::NormalMode
Template Parameters
TThe underlying floating-point data type.
Parameters
[in]iThe index of the normal coordinate to compute, which must lie in the range [0, N].
[in]vectorsThe input vectors to use. Must be a non-nullptr Device pointer pointing to at least N instances.
[in]NThe number of input coordinate vectors, which must not be 0.
[in]shiftThe shift parameter \( S \).

Definition at line 28 of file CUDA/DeviceCode/ImplementationDetails/NormalMode.hpp.

◆ computeNormalCoordinates() [1/2]

template<typename T >
OPENMPCD_CUDA_DEVICE void OpenMPCD::CUDA::DeviceCode::NormalMode::computeNormalCoordinates ( const T *const  vectors,
const std::size_t  N,
T *const  result,
const T  shift = 0 
)

Calculates all normal coordinates for the given array of vectors.

See also
OpenMPCD::NormalMode
Template Parameters
TThe underlying floating-point data type.
Parameters
[in]vectorsThe input vectors to use. Must be a non-nullptr Device pointer pointing to at least 3 * N instances, which will be interpreted as N three-dimensional vectors, with the first three instances belonging to the first vector, and so forth.
[in]NThe number of input coordinate vectors, which must not be 0.
[out]resultBuffer to store the results into. Must be a non-nullptr Device pointer pointing to at least 3 * (N + 1) instances. The first three instances will be set to the three coordinates of the normal mode with index 0, i.e. \( \vec{q}_0 \), and so forth for all normal modes up to and including \( \vec{q}_N \), where \( N \) is the function parameter N.
[in]shiftThe shift parameter \( S \).

Definition at line 79 of file CUDA/DeviceCode/ImplementationDetails/NormalMode.hpp.

◆ computeNormalCoordinates() [2/2]

template<typename T >
__global__ void OpenMPCD::CUDA::DeviceCode::NormalMode::computeNormalCoordinates ( const unsigned int  workUnitOffset,
const unsigned int  chainLength,
const unsigned int  chainCount,
const T *const  positions,
T *const  normalModeCoordinates,
const T  shift = 0 
)

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

See also
OpenMPCD::NormalMode
Template Parameters
TThe underlying floating-point data type.
Parameters
[in]workUnitOffsetThe number of chains to skip.
[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.
[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 \).

Definition at line 94 of file CUDA/DeviceCode/ImplementationDetails/NormalMode.hpp.