45 bool override_cutoff_check) {
51 auto const dist = d.norm();
52 if (dist > min_global_cut and ::communicator.size > 1 and
53 not override_cutoff_check) {
55 <<
"Warning: The distance between virtual and non-virtual particle ("
56 << dist <<
") is larger than the minimum global cutoff ("
57 << min_global_cut <<
"). This may lead to incorrect simulations under "
58 <<
"certain conditions. Adjust the property system.min_global_cut to "
59 <<
"increase the minimum cutoff.";
87 auto relate_to_quat = p_relate_to.
quat();
90 -quat_director[0] * relate_to_quat[1] +
91 quat_director[1] * relate_to_quat[0] +
92 quat_director[2] * relate_to_quat[3] -
93 quat_director[3] * relate_to_quat[2],
94 relate_to_quat[1] * quat_director[3] +
95 relate_to_quat[0] * quat_director[2] -
96 relate_to_quat[3] * quat_director[1] -
97 relate_to_quat[2] * quat_director[0],
98 quat_director[3] * relate_to_quat[0] -
99 relate_to_quat[3] * quat_director[0] +
100 relate_to_quat[2] * quat_director[1] -
101 relate_to_quat[1] * quat_director[2]}}}};
102 quat /= relate_to_quat.
norm2();
106 for (
unsigned int i = 0; i < 4; i++) {
107 if (fabs(qtemp[i] - quat_director[i]) > 1E-9) {
108 fprintf(stderr,
"vs_relate_to: component %u: %f instead of %f\n", i,
109 qtemp[i], quat_director[i]);
112 return std::make_tuple(quat, dist);
Utils::Vector< T, 3 > get_mi_vector(const Utils::Vector< T, 3 > &a, const Utils::Vector< T, 3 > &b) const
Get the minimum-image vector between two coordinates.
Struct holding all information for one particle.
auto const & quat() const
std::tuple< Utils::Quaternion< double >, double > calculate_vs_relate_to_params(Particle const &p_vs, Particle const &p_relate_to, BoxGeometry const &box_geo, double min_global_cut, bool override_cutoff_check)
Calculate the rotation quaternion and distance between two particles.