faunus
Public Member Functions | Public Attributes | List of all members
Faunus::pairpotential::HarmonicBond Struct Reference

Harmonic Bond. More...

#include <bonds.h>

Inheritance diagram for Faunus::pairpotential::HarmonicBond:
Inheritance graph
[legend]
Collaboration diagram for Faunus::pairpotential::HarmonicBond:
Collaboration graph
[legend]

Public Member Functions

Variant type () const override
 
std::shared_ptr< BondDataclone () const override
 
void from_json (const json &j) override
 
void to_json (json &j) const override
 
void setEnergyFunction (const ParticleVector &particles) override
 Set energy and force functors. More...
 
 HarmonicBond (double k, double req, const std::vector< int > &indices)
 

Public Attributes

double half_force_constant = 0.0
 
double equilibrium_distance = 0.0
 

Detailed Description

Harmonic Bond.

U(r) = k/2 * (r - r_eq)^2

Member Function Documentation

◆ setEnergyFunction()

void Faunus::pairpotential::HarmonicBond::setEnergyFunction ( const ParticleVector particles)
override

Set energy and force functors.

Parameters
particlesParticle vector to all particles in the system

This sets both the energyFunc and forceFunc function objects for calculating the potential energy and the forces on the participating atoms


The documentation for this struct was generated from the following files: