Electrostatic forces

namespace mdk
class ESBase : public mdk::NonlocalForce
#include <ESBase.hpp>

A base class for the Debye-Hueckel screened electrostatic potentials.

Subclassed by mdk::ConstDH, mdk::RelativeDH

Public Functions

virtual void bind(Simulation &simulation) override

Bind the class to the simulation. It initializes charge and adds the force to the VL list. Note: this class (ESBase) shouldn’t be added to the simulation class, only the derived classes.

Parameters

simulationSimulation to bind to.

virtual void vlUpdateHook() override

An action to be performed when the Verlet list is updated. Here we want to recreate pairs, i.e. filter the Verlet list so that only charged pairs are present.

Protected Attributes

std::vector<Contact> pairs

A local, filtered Verlet list of pairs. Since most residues are not charged, and pairs even moreso, it benefits us to keep a local list and not check the pairs which we would know cannot interact with each other.

Eigen::Matrix<int8_t, Eigen::Dynamic, 1> charge

A list of charges of the residues (in units of echarge).

struct Contact
#include <ESBase.hpp>

A struct detailing a contact between pairs. We store the indices and the product of the charges.

Public Members

int i1

Index of the first residue.

int i2

Index of the second residue.

double q1_x_q2

Product of residues’ charges.

namespace mdk
class ConstDH : public mdk::ESBase
#include <ConstDH.hpp>

Debye-Hueckel screeened electrostatic potential with constant electric permittivity of the medium.

Public Functions

virtual void asyncPart(Dynamics &dynamics) override

Asynchronous part of the force computation.

Parameters

dynamicsDynamics object to add potential energy and forces to.

Public Members

double screeningDist = 10.0 * angstrom
double permittivity = 80.0 * epsilon_0

Protected Functions

virtual vl::Spec spec() const override

Generate a VL spec.

Returns

Generated VL spec.

namespace mdk
class RelativeDH : public mdk::ESBase
#include <RelativeDH.hpp>

Debye-Hueckel screened electrostatic potential with a distance-dependent electric permittivity (specifically eps_r = r_0/r).

Public Functions

virtual void asyncPart(Dynamics &dynamics) override

Asynchronous part of the force computation.

Parameters

dynamicsDynamics object to add potential energy and forces to.

Public Members

double screeningDist = 10.0 * angstrom
double r0 = 4.0 * angstrom

Protected Functions

virtual vl::Spec spec() const override

Generate a VL spec.

Returns

Generated VL spec.