ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
rotation.cpp File Reference

Molecular dynamics integrator for rotational motion. More...

#include "rotation.hpp"
#include <utils/Vector.hpp>
#include <utils/mask.hpp>
#include <cassert>
#include <cmath>
+ Include dependency graph for rotation.cpp:

Go to the source code of this file.

Functions

static void define_Qdd (Particle const &p, Utils::Quaternion< double > &Qd, Utils::Quaternion< double > &Qdd, Utils::Vector3d &S, Utils::Vector3d &Wd)
 Calculate the derivatives of the quaternion and angular acceleration for a given particle.
 
void propagate_omega_quat_particle (Particle &p, double time_step)
 See [32].
 
void convert_torque_propagate_omega (Particle &p, double time_step)
 
void convert_initial_torques (const ParticleRange &particles)
 Convert torques to the body-fixed frame before the integration loop.
 

Detailed Description

Molecular dynamics integrator for rotational motion.

A velocity Verlet algorithm using quaternions is implemented to tackle rotational motion. See [28] for the method and [3] for the quaternion components indexing used here. A random torque and a friction term are added to provide the constant NVT conditions. Due to this feature all particles are treated as 3D objects with 3 translational and 3 rotational degrees of freedom if ROTATION is compiled in.

Definition in file rotation.cpp.

Function Documentation

◆ convert_initial_torques()

void convert_initial_torques ( const ParticleRange particles)

Convert torques to the body-fixed frame before the integration loop.

Definition at line 188 of file rotation.cpp.

References convert_torque_to_body_frame_apply_fix().

Referenced by System::System::integrate().

◆ convert_torque_propagate_omega()

void convert_torque_propagate_omega ( Particle p,
double  time_step 
)

◆ define_Qdd()

static void define_Qdd ( Particle const &  p,
Utils::Quaternion< double > &  Qd,
Utils::Quaternion< double > &  Qdd,
Utils::Vector3d S,
Utils::Vector3d Wd 
)
static

Calculate the derivatives of the quaternion and angular acceleration for a given particle.

See [40]. Please note that ESPResSo uses scalar-first notation for quaternions, while [40] uses scalar-last notation.

Parameters
[in]pParticle
[out]QdFirst derivative of the particle quaternion
[out]QddSecond derivative of the particle quaternion
[out]SFunction of Qd and Qdd, used to evaluate the Lagrange parameter lambda
[out]WdAngular acceleration of the particle

Definition at line 56 of file rotation.cpp.

References Particle::can_rotate_around(), Utils::Quaternion< T >::norm2(), Particle::omega(), Particle::quat(), Particle::rinertia(), and Particle::torque().

Referenced by propagate_omega_quat_particle().

◆ propagate_omega_quat_particle()

void propagate_omega_quat_particle ( Particle p,
double  time_step 
)

See [32].

Propagate angular velocities and update quaternions on a particle.

Please note that ESPResSo uses scalar-first notation for quaternions, while [32] uses scalar-last notation.

For very high angular velocities (e.g. if the product of time_step with the largest component of p.omega() is superior to ~2.0) and for time_step superior or equal to unity, the calculation might fail.

Todo:
implement for fixed_coord_flag

Definition at line 125 of file rotation.cpp.

References Particle::can_rotate(), define_Qdd(), Utils::Quaternion< T >::identity(), Utils::mask(), Particle::omega(), Particle::quat(), and Particle::rotation().

Referenced by velocity_verlet_rotator_1().