49 static constexpr int num = 2;
54 this->cos_phi0 = cos(
phi0);
57 std::tuple<Utils::Vector3d, Utils::Vector3d, Utils::Vector3d>
67inline std::tuple<Utils::Vector3d, Utils::Vector3d, Utils::Vector3d>
71 auto forceFactor = [
this](
double const cos_phi) {
Vector implementation and trait types for boost qvm interoperability.
Common code for functions calculating angle forces.
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.
double calc_cosine(Utils::Vector3d const &vec1, Utils::Vector3d const &vec2, bool sanitize_cosine=false)
Compute the cosine of the angle between three particles.
DEVICE_QUALIFIER constexpr T sqr(T x)
Calculates the SQuaRe of x.
Parameters for three-body angular potential (cossquare).
double cos_phi0
cosine of phi0 (internal parameter)
double phi0
equilibrium angle (default is 180 degrees)
AngleCossquareBond(double bend, double phi0)
double bend
bending constant
double energy(Utils::Vector3d const &vec1, Utils::Vector3d const &vec2) const
Computes the three-body angle interaction energy.
std::tuple< Utils::Vector3d, Utils::Vector3d, Utils::Vector3d > forces(Utils::Vector3d const &vec1, Utils::Vector3d const &vec2) const
Compute the three-body angle interaction force.