OpenMPCD
Functions
OpenMPCD::NormalMode Namespace Reference

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

Functions

template<typename T >
const 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...
 

Detailed Description

Namespace for functionality related to normal modes.

Given a number \( N \) of coordinate vectors \( \vec{r}_n \), \( n \in \left[ 1, N \right] \), the \( i \)-th normal coordinate \( \vec{q}_i \), with \( i \in \left[ 0, N \right] \), is defined as

\[ \vec{q}_i = \frac{1}{N} \sum_{n=1}^N \cos\left( \frac{ i \pi \left( n + S \right) }{N} \right) \vec{r}_n \]

where \( S \) is a shift parameter.

Function Documentation

◆ computeNormalCoordinate()

template<typename T >
const Vector3D< T > OpenMPCD::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
Exceptions
OpenMPCD::NULLPointerExceptionIf OPENMPCD_DEBUG is defined, throws if vectors == nullptr.
OpenMPCD::InvalidArgumentExceptionIf OPENMPCD_DEBUG is defined, throws if N == 0, or if i is out of range.
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 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 22 of file ImplementationDetails/NormalMode.hpp.