46 bool override_cutoff_check) {
52 auto const dist = d.norm();
53 if (dist > min_global_cut and ::communicator.size > 1 and
54 not override_cutoff_check) {
56 <<
"Warning: The distance between virtual and non-virtual particle ("
57 << dist <<
") is larger than the minimum global cutoff ("
58 << min_global_cut <<
"). This may lead to incorrect simulations under "
59 <<
"certain conditions. Adjust the property system.min_global_cut to "
60 <<
"increase the minimum cutoff.";
88 auto relate_to_quat = p_relate_to.
quat();
91 -quat_director[0] * relate_to_quat[1] +
92 quat_director[1] * relate_to_quat[0] +
93 quat_director[2] * relate_to_quat[3] -
94 quat_director[3] * relate_to_quat[2],
95 relate_to_quat[1] * quat_director[3] +
96 relate_to_quat[0] * quat_director[2] -
97 relate_to_quat[3] * quat_director[1] -
98 relate_to_quat[2] * quat_director[0],
99 quat_director[3] * relate_to_quat[0] -
100 relate_to_quat[3] * quat_director[0] +
101 relate_to_quat[2] * quat_director[1] -
102 relate_to_quat[1] * quat_director[2]}}}};
103 quat /= relate_to_quat.
norm2();
106 constexpr auto const location = std::source_location::current();
107 constexpr auto const *function_name = location.function_name();
108 constexpr auto *error_msg =
"%s: component %u: %f instead of %f\n";
110 for (
unsigned int i = 0; i < 4; i++) {
111 if (fabs(qtemp[i] - quat_director[i]) != 0.) {
112 fprintf(stderr, error_msg, function_name, i, qtemp[i], quat_director[i]);
115 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.