ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
This file contains all subroutines required to process rotational motion. More...
#include "config/config.hpp"
#include "Particle.hpp"
#include "ParticleRange.hpp"
#include <utils/Vector.hpp>
#include <utils/mask.hpp>
#include <utils/math/quaternion.hpp>
#include <utils/matrix.hpp>
#include <utils/quaternion.hpp>
#include <cassert>
#include <cmath>
#include <limits>
#include <utility>
Go to the source code of this file.
Functions | |
void | propagate_omega_quat_particle (Particle &p, double time_step) |
Propagate angular velocities and update quaternions on a particle. | |
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. | |
Utils::Vector3d | convert_vector_body_to_space (const Particle &p, const Utils::Vector3d &vec) |
Utils::Vector3d | convert_vector_space_to_body (const Particle &p, const Utils::Vector3d &v) |
template<class T > | |
auto | convert_body_to_space (const Utils::Quaternion< double > &quat, const Utils::Matrix< T, 3, 3 > &A) |
Transform matrix from body- to space-fixed frame. | |
template<class T > | |
auto | convert_body_to_space (const Particle &p, const Utils::Matrix< T, 3, 3 > &A) |
Transform matrix from body- to space-fixed frame. | |
std::pair< Utils::Quaternion< double >, double > | convert_dip_to_quat (const Utils::Vector3d &dip) |
convert a dipole moment to quaternions and dipolar strength | |
Utils::Quaternion< double > | local_rotate_particle_body (Particle const &p, const Utils::Vector3d &axis_body_frame, const double phi) |
Rotate the particle p around the body-frame defined NORMALIZED axis aBodyFrame by amount phi . | |
void | local_rotate_particle (Particle &p, const Utils::Vector3d &axis_space_frame, const double phi) |
Rotate the particle p around the NORMALIZED axis aSpaceFrame by amount phi. | |
void | convert_torque_to_body_frame_apply_fix (Particle &p) |
This file contains all subroutines required to process rotational motion.
Definition in file rotation.hpp.
auto convert_body_to_space | ( | const Particle & | p, |
const Utils::Matrix< T, 3, 3 > & | A | ||
) |
Transform matrix from body- to space-fixed frame.
T | Scalar type |
p | Particle transforming from. |
A | Matrix representation in body-fixed coordinates. |
Definition at line 100 of file rotation.hpp.
References convert_body_to_space(), and Particle::quat().
auto convert_body_to_space | ( | const Utils::Quaternion< double > & | quat, |
const Utils::Matrix< T, 3, 3 > & | A | ||
) |
Transform matrix from body- to space-fixed frame.
Given a linear map represented by \( A \in \mathbb{R}^{3 \times 3}\) in the body-fixed frame, this returns the matrix \( A \in \mathbb{R}^{3 \times 3}\) representing the map in the space-fixed frame. They are related by the map between the space-fixed and body-fixed frame \(O\) like
\[ A' = O A O^T. \]
T | Scalar type |
quat | quaternion to transform from, i.e. the rotation that transforms space- to body-fixed frame. |
A | Matrix representation in body-fixed coordinates. |
Definition at line 86 of file rotation.hpp.
References Utils::Matrix< T, Rows, Cols >::transposed().
Referenced by convert_body_to_space(), and Thermostat::handle_particle_anisotropy().
|
inline |
convert a dipole moment to quaternions and dipolar strength
Definition at line 108 of file rotation.hpp.
References Utils::convert_director_to_quaternion(), and Utils::Vector< T, N >::norm().
Referenced by ScriptInterface::Particles::ParticleHandle::ParticleHandle().
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().
void convert_torque_propagate_omega | ( | Particle & | p, |
double | time_step | ||
) |
Definition at line 159 of file rotation.cpp.
References Particle::can_rotate(), convert_torque_to_body_frame_apply_fix(), Particle::omega(), Particle::rinertia(), and Particle::torque().
Referenced by velocity_verlet_rotator_2().
|
inline |
Definition at line 143 of file rotation.hpp.
References convert_vector_space_to_body(), Particle::rotation(), and Particle::torque().
Referenced by brownian_dynamics_rotator(), convert_initial_torques(), and convert_torque_propagate_omega().
|
inline |
Definition at line 57 of file rotation.hpp.
References Particle::quat().
Referenced by ParticleObservables::traits< Particle >::angular_velocity(), bd_drag(), bd_drag_vel(), bd_random_walk(), ScriptInterface::Particles::ParticleHandle::do_call_method(), ScriptInterface::Particles::ParticleHandle::ParticleHandle(), System::System::thermostat_force_init(), and velocity().
|
inline |
Definition at line 61 of file rotation.hpp.
References Particle::quat().
Referenced by bd_drag(), bd_drag_vel(), convert_torque_to_body_frame_apply_fix(), ScriptInterface::Particles::ParticleHandle::do_call_method(), local_rotate_particle(), ScriptInterface::Particles::ParticleHandle::ParticleHandle(), and ParticleObservables::traits< Particle >::velocity_body().
|
inline |
Rotate the particle p around the NORMALIZED axis aSpaceFrame by amount phi.
Definition at line 133 of file rotation.hpp.
References convert_vector_space_to_body(), local_rotate_particle_body(), and Particle::quat().
Referenced by ScriptInterface::Particles::ParticleHandle::do_call_method(), ScriptInterface::System::rotate_system(), steepest_descent_step(), and stokesian_dynamics_step_1().
|
inline |
Rotate the particle p around the body-frame defined NORMALIZED axis aBodyFrame
by amount phi
.
Definition at line 119 of file rotation.hpp.
References Particle::can_rotate(), Particle::quat(), and Particle::rotation().
Referenced by bd_drag_rot(), bd_random_walk_rot(), and local_rotate_particle().
void propagate_omega_quat_particle | ( | Particle & | p, |
double | time_step | ||
) |
Propagate angular velocities and update quaternions on a particle.
Propagate angular velocities and update quaternions on a particle.
Please note that ESPResSo uses scalar-first notation for quaternions, while [31] 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.
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().