Forces

class mdk::Force : public mdk::SimulVar

An abstract interface for the force fields. Certain forces (QA in particular) have a multi-stage evaluation. Thus we separated the computation to an “asynchronous” and “synchronous” parts, where the latter get executed in order of addition to the Simulation object.

Subclassed by mdk::BondAngles, mdk::Chirality, mdk::DihedralAngles, mdk::NonlocalForce, mdk::SolidWall, mdk::Tether

Public Functions

virtual void bind(Simulation &simulation) override

Bind the force to the simulation. This class shouldn’t be actually added to the simulation, but rather serves as a prototype for actual forces; in particular it saved state from the Simulation object.

Parameters

simulation

virtual void asyncPart(Dynamics &dynamics)

Asynchronous part of the force computation.

Parameters

dynamicsDynamics object to add potential energy and forces to.

virtual void syncPart(Dynamics &dynamics)

Synchronous part of the force computation.

Parameters

dynamicsDynamics object to add potential energy and forces to.

Protected Attributes

State const *state = nullptr

A const pointer to the State of simulation. The const-ness is a declaration that the State is only modified by the integrator, and thus asyncPart can be safely executed.