45#include "types/CharmmTorsionType.hpp"
58 CharmmTorsionType::CharmmTorsionType(
59 std::vector<CharmmTorsionParameter>& parameters) :
62 std::vector<CharmmTorsionParameter>::iterator i;
63 i = std::max_element(parameters.begin(), parameters.end(),
65 if (i != parameters.end()) {
73 for (i = parameters.begin(); i != parameters.end(); ++i) {
75 cosTerm *= (cos(i->delta) * i->kchi);
79 sinTerm *= -(sin(i->delta) * i->kchi);
88 void CharmmTorsionType::calcForce(RealType cosPhi, RealType& V,
89 RealType& dVdCosPhi) {
93 }
else if (cosPhi < -1.0) {
97 RealType sinPhi = sqrt(1.0 - cosPhi * cosPhi);
101 if (fabs(sinPhi) < 1.0E-6) { sinPhi = copysign(1.0E-6, sinPhi); }
107 dVdCosPhi += U_.
evaluate(cosPhi) / (2.0 * sinPhi);
A collection of Chebyshev Polynomials.
A collection of Chebyshev Polynomials.
Real evaluateDerivative(const Real &x)
Returns the first derivative of this polynomial.
Real evaluate(const Real &x)
Calculates the value of this Polynomial evaluated at the given x value.
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.