Collective Variables Module - Developer Documentation
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
rotation_derivative< T1, T2 > Struct Template Reference

Helper class for calculating the derivative of rotation. More...

#include <colvar_rotation_derivative.h>

Collaboration diagram for rotation_derivative< T1, T2 >:
Collaboration graph
[legend]

Public Member Functions

 rotation_derivative (const cvm::rotation &rot, const std::vector< T1 > &pos1, const std::vector< T2 > &pos2)
 Constructor of the cvm::rotation::derivative class. More...
 
void prepare_derivative (rotation_derivative_dldq require_dl_dq)
 This function must be called before calc_derivative_wrt_group1 and calc_derivative_wrt_group2 in order to prepare the tmp_Q0Q0 and tmp_Q0Q0_L. More...
 
template<bool use_dl, bool use_dq, bool use_ds>
void calc_derivative_impl (const cvm::rvector(&ds)[4][4], cvm::rvector *_noalias const dl0_out, cvm::vector1d< cvm::rvector > *_noalias const dq0_out, cvm::matrix2d< cvm::rvector > *_noalias const ds_out) const
 Actual implementation of the derivative calculation. More...
 
template<bool use_dl, bool use_dq, bool use_ds>
void calc_derivative_wrt_group1 (size_t ia, cvm::rvector *_noalias const dl0_1_out=nullptr, cvm::vector1d< cvm::rvector > *_noalias const dq0_1_out=nullptr, cvm::matrix2d< cvm::rvector > *_noalias const ds_1_out=nullptr) const
 Calculate the derivatives of S, the leading eigenvalue L and the leading eigenvector Q with respect to m_pos1 More...
 
template<bool use_dl, bool use_dq, bool use_ds>
void calc_derivative_wrt_group2 (size_t ia, cvm::rvector *_noalias const dl0_2_out=nullptr, cvm::vector1d< cvm::rvector > *_noalias const dq0_2_out=nullptr, cvm::matrix2d< cvm::rvector > *_noalias const ds_2_out=nullptr) const
 Calculate the derivatives of S, the leading eigenvalue L and the leading eigenvector Q with respect to m_pos2 More...
 

Public Attributes

const cvm::rotationm_rot
 Reference to the rotation.
 
const std::vector< T1 > & m_pos1
 Reference to the atom positions of group 1.
 
const std::vector< T2 > & m_pos2
 Reference to the atom positions of group 2.
 
cvm::real tmp_Q0Q0 [4][4]
 Temporary variable that will be updated if prepare_derivative called.
 
cvm::real tmp_Q0Q0_L [4][4][4]
 

Detailed Description

template<typename T1, typename T2>
struct rotation_derivative< T1, T2 >

Helper class for calculating the derivative of rotation.

Constructor & Destructor Documentation

◆ rotation_derivative()

template<typename T1 , typename T2 >
rotation_derivative< T1, T2 >::rotation_derivative ( const cvm::rotation rot,
const std::vector< T1 > &  pos1,
const std::vector< T2 > &  pos2 
)
inline

Constructor of the cvm::rotation::derivative class.

Parameters
[in]rotThe cvm::rotation object (must have called calc_optimal_rotation before calling calc_derivative_wrt_group1 and calc_derivative_wrt_group2)
[in]pos1The atom positions of group 1
[in]pos2The atom positions of group 2

Member Function Documentation

◆ calc_derivative_impl()

template<typename T1 , typename T2 >
template<bool use_dl, bool use_dq, bool use_ds>
void rotation_derivative< T1, T2 >::calc_derivative_impl ( const cvm::rvector(&)  ds[4][4],
cvm::rvector *_noalias const  dl0_out,
cvm::vector1d< cvm::rvector > *_noalias const  dq0_out,
cvm::matrix2d< cvm::rvector > *_noalias const  ds_out 
) const
inline

Actual implementation of the derivative calculation.

Parameters
[in]dsThe derivative of matrix S with respect to an atom of either group 1 or group 2
[out]dl0_outThe output of derivative of L
[out]dq0_outThe output of derivative of Q
[out]ds_outThe output of derivative of overlap matrix S

◆ calc_derivative_wrt_group1()

template<typename T1 , typename T2 >
template<bool use_dl, bool use_dq, bool use_ds>
void rotation_derivative< T1, T2 >::calc_derivative_wrt_group1 ( size_t  ia,
cvm::rvector *_noalias const  dl0_1_out = nullptr,
cvm::vector1d< cvm::rvector > *_noalias const  dq0_1_out = nullptr,
cvm::matrix2d< cvm::rvector > *_noalias const  ds_1_out = nullptr 
) const
inline

Calculate the derivatives of S, the leading eigenvalue L and the leading eigenvector Q with respect to m_pos1

Parameters
[in]iaThe index the of atom
[out]dl0_1_outThe output of derivative of L with respect to ia-th atom of group 1
[out]dq0_1_outThe output of derivative of Q with respect to ia-th atom of group 1
[out]ds_1_outThe output of derivative of overlap matrix S with respect to ia-th atom of group 1

◆ calc_derivative_wrt_group2()

template<typename T1 , typename T2 >
template<bool use_dl, bool use_dq, bool use_ds>
void rotation_derivative< T1, T2 >::calc_derivative_wrt_group2 ( size_t  ia,
cvm::rvector *_noalias const  dl0_2_out = nullptr,
cvm::vector1d< cvm::rvector > *_noalias const  dq0_2_out = nullptr,
cvm::matrix2d< cvm::rvector > *_noalias const  ds_2_out = nullptr 
) const
inline

Calculate the derivatives of S, the leading eigenvalue L and the leading eigenvector Q with respect to m_pos2

Parameters
[in]iaThe index the of atom
[out]dl0_2_outThe output of derivative of L with respect to ia-th atom of group 2
[out]dq0_2_outThe output of derivative of Q with respect to ia-th atom of group 2
[out]ds_2_outThe output of derivative of overlap matrix S with respect to ia-th atom of group 2

◆ prepare_derivative()

template<typename T1 , typename T2 >
void rotation_derivative< T1, T2 >::prepare_derivative ( rotation_derivative_dldq  require_dl_dq)
inline

This function must be called before calc_derivative_wrt_group1 and calc_derivative_wrt_group2 in order to prepare the tmp_Q0Q0 and tmp_Q0Q0_L.

Parameters
[in]require_dl_dqRequire the calculation of the derivatives of L or/and Q with respect to atoms.

The documentation for this struct was generated from the following file: