Harmonic potential kernel

class mdk::Harmonic

Harmonic force “kernel”, i.e. a separated class responsible only for the computation of the formula. The definitions are inlined in order for the compiler to inline them.

Public Functions

Harmonic() = default
inline Harmonic(double H1, double H2)
inline void computeV(double dx, double &V, double &dV_dx) const

Compute the potential energy of the force field.

Parameters
  • dx – Displacement, i.e. the difference between current length and the equilibrium length

  • V – Variable to add the potential to.

  • dV_dx – Variable to add the derivative to.

template<typename T1, typename T2>
inline void computeF(VRef unit, double dx, double &V, T1 F1, T2 F2) const

Compute and add the harmonic force between two residues. The templates are here in order for us to be able to pass Eigen expressions to it.

Template Parameters
  • T1 – Type of an lvalue to add the force on the first residue to.

  • T2 – Type of an lvalue to add the force on the second residue to.

Parameters
  • unit – Normalized vector between the residues.

  • dx – Displacement, i.e. the difference between current length and the equilibrium length;

  • V – Variable to add the potential to.

  • F1 – Lvalue to add the force on the first residue to.

  • F2 – Lvalue to add the force on the second residue to.

Public Members

double H1 = 50.0 * eps / pow(angstrom, 2.0)

“Harmonic” part of the harmonic potential.

double H2 = 0.0

“Anharmonic” part of the harmonic potential. From what I have seen it’s pretty much always zero, perhaps it’s a legacy/deprecated feature.