ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
Routines to calculate the dihedral energy or/and force for a particle quadruple. More...
#include "config/config.hpp"
#include <utils/Vector.hpp>
#include <cmath>
#include <numbers>
#include <optional>
#include <tuple>
Go to the source code of this file.
Classes | |
struct | DihedralBond |
Parameters for four-body angular potential (dihedral-angle potentials). More... | |
Functions | |
bool | calc_dihedral_angle (Utils::Vector3d const &a, Utils::Vector3d const &b, Utils::Vector3d const &c, Utils::Vector3d &aXb, double &l_aXb, Utils::Vector3d &bXc, double &l_bXc, double &cosphi, double &phi) |
Calculates the dihedral angle between particle quadruple p1, p2, p3 and p4. | |
Routines to calculate the dihedral energy or/and force for a particle quadruple.
Note that usage of dihedrals increases the interaction range of bonded interactions to 2 times the maximal bond length!
Definition in file dihedral.hpp.
|
inline |
Calculates the dihedral angle between particle quadruple p1, p2, p3 and p4.
The dihedral angle is the angle between the planes specified by the particle triples (p1,p2,p3) and (p2,p3,p4). Vectors a, b and c are the bond vectors between consecutive particles. If the a,b or b,c are parallel the dihedral angle is not defined in which case the function returns true. Calling functions should check for that.
[in] | a | Vector from p1 to p2 |
[in] | b | Vector from p2 to p3 |
[in] | c | Vector from p3 to p4 |
[out] | aXb | Vector product of a and b |
[out] | l_aXb | |aXB| |
[out] | bXc | Vector product of b and c |
[out] | l_bXc | |bXc| |
[out] | cosphi | Cosine of the dihedral angle |
[out] | phi | Dihedral angle in the range [0, pi] |
Definition at line 87 of file dihedral.hpp.
References Utils::Vector< T, N >::norm(), TINY_LENGTH_VALUE, TINY_SIN_VALUE, and vector_product().
Referenced by TabulatedDihedralBond::energy(), DihedralBond::energy(), TabulatedDihedralBond::forces(), and DihedralBond::forces().