![]() |
ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
Common code for functions calculating angle forces. More...
#include "config/config.hpp"#include <utils/Vector.hpp>#include <algorithm>#include <cmath>#include <tuple>
Include dependency graph for angle_common.hpp:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Functions | |
| double | calc_cosine (Utils::Vector3d const &vec1, Utils::Vector3d const &vec2, bool sanitize_cosine=false) |
| Compute the cosine of the angle between three particles. | |
| template<typename ForceFactor > | |
| std::tuple< Utils::Vector3d, Utils::Vector3d, Utils::Vector3d > | angle_generic_force (Utils::Vector3d const &vec1, Utils::Vector3d const &vec2, ForceFactor forceFactor, bool sanitize_cosine) |
| Compute a three-body angle interaction force. | |
Variables | |
| constexpr auto | tiny_cos_angle_value {0.9999999999} |
| Tiny angle cutoff for cosine calculations. | |
Common code for functions calculating angle forces.
Definition in file angle_common.hpp.
| std::tuple< Utils::Vector3d, Utils::Vector3d, Utils::Vector3d > angle_generic_force | ( | Utils::Vector3d const & | vec1, |
| Utils::Vector3d const & | vec2, | ||
| ForceFactor | forceFactor, | ||
| bool | sanitize_cosine | ||
| ) |
Compute a three-body angle interaction force.
See the details in General expressions for the forces. The \( K(\theta_{ijk}) \) term is provided as a lambda function in forceFactor.
| [in] | vec1 | Vector from central particle to left particle. |
| [in] | vec2 | Vector from central particle to right particle. |
| [in] | forceFactor | Angle force term. |
| [in] | sanitize_cosine | Sanitize the cosine of the angle. |
| ForceFactor | Function evaluating the angle force term for a given angle. |
Definition at line 75 of file angle_common.hpp.
References Utils::Vector< T, N >::norm(), and tiny_cos_angle_value.
Referenced by AngleCosineBond::forces(), AngleCossquareBond::forces(), AngleHarmonicBond::forces(), and TabulatedAngleBond::forces().
|
inline |
Compute the cosine of the angle between three particles.
| [in] | vec1 | Vector from central particle to left particle. |
| [in] | vec2 | Vector from central particle to right particle. |
| [in] | sanitize_cosine | Sanitize the cosine of the angle. |
Definition at line 49 of file angle_common.hpp.
References Utils::Vector< T, N >::norm2(), and tiny_cos_angle_value.
Referenced by AngleCosineBond::energy(), AngleCossquareBond::energy(), AngleHarmonicBond::energy(), and TabulatedAngleBond::energy().
|
inlineconstexpr |
Tiny angle cutoff for cosine calculations.
Definition at line 37 of file angle_common.hpp.
Referenced by angle_generic_force(), calc_cosine(), and Observables::BondAngles::evaluate().